diff options
author | Adam Nemet <anemet@caviumnetworks.com> | 2009-01-28 02:55:20 +0000 |
---|---|---|
committer | Adam Nemet <nemet@gcc.gnu.org> | 2009-01-28 02:55:20 +0000 |
commit | bee6fa6d32b8a231cae2af0cf700456d827a507e (patch) | |
tree | f191db5683ac9ece9c05e4e999f873fb140b3fa0 /gcc | |
parent | 2b5ba03731292c4e012be4acc95e81d488af1771 (diff) | |
download | gcc-bee6fa6d32b8a231cae2af0cf700456d827a507e.zip gcc-bee6fa6d32b8a231cae2af0cf700456d827a507e.tar.gz gcc-bee6fa6d32b8a231cae2af0cf700456d827a507e.tar.bz2 |
c.opt (Wpacked-bitfield-compat): Change init value to -1.
* 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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/c-opts.c | 5 | ||||
-rw-r--r-- | gcc/c.opt | 2 | ||||
-rw-r--r-- | gcc/stor-layout.c | 2 |
4 files changed, 16 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 39f89ec..8b99dc9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/c-opts.c b/gcc/c-opts.c index 1c228dd..a7ff6cc 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -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. */ @@ -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 diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index bf896db..1a33b1c 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -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", |