diff mbox

[7/12] New configure option --enable-espf=(all|ssp|pie|no)

Message ID 2653918.LFiUD7sXiM@laptop1.gw.ume.nu
State New
Headers show

Commit Message

Magnus Granberg Sept. 7, 2012, 2:29 p.m. UTC
Patch: Wformat.patch
Enable -Wformat and -Wformat_security

Gentoo Hardened Project
Magnus Granberg
diff mbox

Patch

--- a/gcc/c-family/c-common.c	2012-02-13 21:12:54.000000000 +0100
+++ b/gcc/c-family/c-common.c	2012-07-28 00:04:05.351725091 +0200
@@ -202,7 +202,11 @@  int warn_unknown_pragmas; /* Tri state v
 /* Warn about format/argument anomalies in calls to formatted I/O functions
    (*printf, *scanf, strftime, strfmon, etc.).  */
 
+#ifdef ENABLE_ESPF
+int warn_format = 1;
+#else
 int warn_format;
+#endif
 
 /* C/ObjC language option variables.  */
 
--- a/gcc/c-family/c-format.c	2011-06-07 23:52:46.000000000 +0200
+++ b/gcc/c-family/c-format.c	2012-07-28 00:43:00.612794680 +0200
@@ -52,6 +52,11 @@  set_Wformat (int setting)
   /* Make sure not to disable -Wnonnull if -Wformat=0 is specified.  */
   if (setting)
     warn_nonnull = setting;
+
+#ifdef ENABLE_ESPF
+  if (setting == 1)
+    warn_format_security = 1;
+#endif
 }