This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Turn on -Wpsabi only for the C languages


We want to turn on -Wpsabi for the C languages. This patch does it.
OK for trunk?

Thanks.

H.J.
----
2009-02-18  H.J. Lu  <hongjiu.lu@intel.com>

	* c-opts.c (c_common_post_options): Turn on warn_psabi only for
	the C languages.

	* c.opt (Wpsabi): Initialize to -1.

	* config/i386/i386.c (classify_argument): Check warn_psabi == 1.

--- gcc/c-opts.c.bar	2009-02-17 21:52:28.000000000 -0800
+++ gcc/c-opts.c	2009-02-18 07:00:13.000000000 -0800
@@ -1095,6 +1095,11 @@ c_common_post_options (const char **pfil
   if (warn_packed_bitfield_compat == -1)
     warn_packed_bitfield_compat = 1;
 
+  /* -Wpsabi is on by default for the C languages.  The warning is
+     issued in back-end so we need to selectively turn it on here.  */
+  if (warn_psabi == -1)
+    warn_psabi = 1;
+
   /* Special format checking options don't work without -Wformat; warn if
      they are used.  */
   if (!warn_format)
--- gcc/c.opt.bar	2009-02-18 06:58:04.000000000 -0800
+++ gcc/c.opt	2009-02-18 06:57:11.000000000 -0800
@@ -116,7 +116,7 @@ C ObjC C++ ObjC++ Var(warn_abi) Warning
 Warn about things that will change when compiling with an ABI-compliant compiler
 
 Wpsabi
-C ObjC C++ ObjC++ Var(warn_psabi) Init(1) Undocumented
+C ObjC C++ ObjC++ Var(warn_psabi) Init(-1) Undocumented
 
 Waddress
 C ObjC C++ ObjC++ Var(warn_address) Warning
--- gcc/config/i386/i386.c.bar	2009-02-17 21:52:28.000000000 -0800
+++ gcc/config/i386/i386.c	2009-02-18 07:00:50.000000000 -0800
@@ -5031,7 +5031,7 @@ classify_argument (enum machine_mode mod
 
 	      /* The first one should never be X86_64_X87UP_CLASS.  */
 	      gcc_assert (i != 0);
-	      if (!warned && warn_psabi)
+	      if (!warned && warn_psabi == 1)
 		{
 		  warned = true;
 		  inform (input_location,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]