[llvm-commits] [llvm-gcc-4.2] r58931 - in /llvm-gcc-4.2/trunk/gcc: c-common.c c.opt config/i386/darwin.h config/rs6000/darwin.h

Nick Lewycky nicholas at mxc.ca
Sun Nov 9 00:43:16 PST 2008


Author: nicholas
Date: Sun Nov  9 02:43:15 2008
New Revision: 58931

URL: http://llvm.org/viewvc/llvm-project?rev=58931&view=rev
Log:
Reapply r56946, which is a reapply of r56905. Don't turn on -Wformat except
on Darwin. Now featuring LLVM LOCAL tags. Fixes PR3030.

Modified:
    llvm-gcc-4.2/trunk/gcc/c-common.c
    llvm-gcc-4.2/trunk/gcc/c.opt
    llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h
    llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h

Modified: llvm-gcc-4.2/trunk/gcc/c-common.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=58931&r1=58930&r2=58931&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-common.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-common.c Sun Nov  9 02:43:15 2008
@@ -297,8 +297,10 @@
 /* Warn about format/argument anomalies in calls to formatted I/O functions
    (*printf, *scanf, strftime, strfmon, etc.).  */
 
+/* LLVM LOCAL begin */
 /* APPLE LOCAL default to Wformat-security 5764921 */
-int warn_format = 1;
+int warn_format;
+/* LLVM LOCAL end */
 
 /* Warn about using __null (as NULL in C++) as sentinel.  For code compiled
    with GCC this doesn't matter as __null is guaranteed to have the right

Modified: llvm-gcc-4.2/trunk/gcc/c.opt
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c.opt?rev=58931&r1=58930&r2=58931&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c.opt (original)
+++ llvm-gcc-4.2/trunk/gcc/c.opt Sun Nov  9 02:43:15 2008
@@ -236,11 +236,11 @@
 C ObjC C++ ObjC++ Var(warn_format_nonliteral)
 Warn about format strings that are not literals
 
-; APPLE LOCAL begin default to Wformat-security 5764921
+; LLVM LOCAL begin don't enable Wformat-security for non-Darwin
 Wformat-security
-C ObjC C++ ObjC++ Var(warn_format_security) Init(1)
+C ObjC C++ ObjC++ Var(warn_format_security) Init(0)
 Warn about possible security problems with format functions
-; APPLE LOCAL end default to Wformat-security 5764921
+; LLVM LOCAL end
 
 Wformat-y2k
 C ObjC C++ ObjC++ Var(warn_format_y2k)

Modified: llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h?rev=58931&r1=58930&r2=58931&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h Sun Nov  9 02:43:15 2008
@@ -101,6 +101,8 @@
   %{!mmacosx-version-min=*: %{!miphoneos-version-min=*: %(darwin_cc1_minversion)}} \
   "/* APPLE LOCAL ignore -mcpu=G4 -mcpu=G5 */"\
   %<faltivec %<mno-fused-madd %<mlong-branch %<mlongcall %<mcpu=G4 %<mcpu=G5 \
+  "/* LLVM LOCAL enable format security warnings */"\
+  %{!Wno-format:-Wformat -Wformat-security} \
   %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }}"
 
 /* APPLE LOCAL AltiVec */

Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h?rev=58931&r1=58930&r2=58931&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h Sun Nov  9 02:43:15 2008
@@ -113,6 +113,8 @@
   %{static: %{Zdynamic: %e conflicting code gen style switches are used}}\
   "/* APPLE LOCAL ARM 5683689 */"\
   %{!mmacosx-version-min=*: %{!miphoneos-version-min=*: %(darwin_cc1_minversion)}} \
+  "/* LLVM LOCAL enable format security warnings */"\
+  %{!Wno-format:-Wformat -Wformat-security} \
   "/* APPLE LOCAL -fast or -fastf or -fastcp */"\
   %{!mkernel:%{!static:%{!fast:%{!fastf:%{!fastcp:%{!mdynamic-no-pic:-fPIC}}}}}}"
 





More information about the llvm-commits mailing list