c.opt (Wpacked-bitfield-compat): Change init value to -1.
authorAdam Nemet <anemet@caviumnetworks.com>
Wed, 28 Jan 2009 02:55:20 +0000 (02:55 +0000)
committerAdam Nemet <nemet@gcc.gnu.org>
Wed, 28 Jan 2009 02:55:20 +0000 (02:55 +0000)
* c.opt (Wpacked-bitfield-compat): Change init value to -1.
* c-opts.c (c_common_post_options): If -W*packed-bitfield-compat
was not supplied then set warn_packed_bitfield_compat to the
default value of 1.
* stor-layout.c (place_field): Check warn_packed_bitfield_compat
against 1.

From-SVN: r143718

gcc/ChangeLog
gcc/c-opts.c
gcc/c.opt
gcc/stor-layout.c

index 39f89ecca8fb0de229c44eeebbb853aafb6bdd44..8b99dc968bbde5a44f034208f1bf8f99b07b735e 100644 (file)
@@ -1,3 +1,12 @@
+2009-01-27  Adam Nemet  <anemet@caviumnetworks.com>
+
+       * c.opt (Wpacked-bitfield-compat): Change init value to -1.
+       * c-opts.c (c_common_post_options): If -W*packed-bitfield-compat
+       was not supplied then set warn_packed_bitfield_compat to the
+       default value of 1.
+       * stor-layout.c (place_field): Check warn_packed_bitfield_compat
+       against 1.
+
 2009-01-27  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/38503
index 1c228dd5441f21b29e7238a429a99fe0ca37b75a..a7ff6cc6d4506f971cb588ec278dff43286412a3 100644 (file)
@@ -1085,6 +1085,11 @@ c_common_post_options (const char **pfilename)
   if (warn_sign_conversion == -1)
     warn_sign_conversion =  (c_dialect_cxx ()) ? 0 : warn_conversion;
 
+  /* -Wpacked-bitfield-compat is on by default for the C languages.  The
+     warning is issued in stor-layout.c which is not part of the front-end so
+     we need to selectively turn it on here.  */
+  if (warn_packed_bitfield_compat == -1)
+    warn_packed_bitfield_compat = 1;
 
   /* Special format checking options don't work without -Wformat; warn if
      they are used.  */
index 75b7042dfb189a8765e42e0233599a74c8ed279a..e512ec663944029075fb9ad39cde6a927c869ba0 100644 (file)
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -365,7 +365,7 @@ C ObjC Var(warn_override_init) Init(-1) Warning
 Warn about overriding initializers without side effects
 
 Wpacked-bitfield-compat
-C ObjC C++ ObjC++ Var(warn_packed_bitfield_compat) Init(1) Warning
+C ObjC C++ ObjC++ Var(warn_packed_bitfield_compat) Init(-1) Warning
 Warn about packed bit-fields whose offset changed in GCC 4.4
 
 Wparentheses
index bf896dbed372e9911d774f46ece79979134031aa..1a33b1c54d65b07f5cfcd180251c26876777b807 100644 (file)
@@ -963,7 +963,7 @@ place_field (record_layout_info rli, tree field)
        {
          if (DECL_PACKED (field))
            {
-             if (warn_packed_bitfield_compat)
+             if (warn_packed_bitfield_compat == 1)
                inform
                  (input_location,
                   "Offset of packed bit-field %qD has changed in GCC 4.4",