diff options
| author | Josh Triplett <josh@freedesktop.org> | 2007-05-22 13:30:58 -0700 |
|---|---|---|
| committer | Josh Triplett <josh@freedesktop.org> | 2007-05-22 13:30:58 -0700 |
| commit | 63eaf03c8323ce027dc3cd16ae050c57daec6eed (patch) | |
| tree | 251b67fc51714ee46241717b007c7736207cda28 | |
| parent | 1cc42170efe8cdb5f3b1e41e26d796e04c31dc95 (diff) | |
| download | sparse-dev-63eaf03c8323ce027dc3cd16ae050c57daec6eed.tar.gz | |
Add -Wno-old-initializer to turn off warnings about non-C99 struct initializers
Signed-off-by: Josh Triplett <josh@freedesktop.org>
| -rwxr-xr-x | cgcc | 2 | ||||
| -rw-r--r-- | lib.c | 2 | ||||
| -rw-r--r-- | lib.h | 1 | ||||
| -rw-r--r-- | parse.c | 3 |
4 files changed, 6 insertions, 2 deletions
@@ -66,7 +66,7 @@ exit 0; sub check_only_option { my ($arg) = @_; - return 1 if $arg =~ /^-W(no-?)?(default-bitfield-sig|one-bit-signed-bitfield|cast-truncate|bitwise|typesign|context|undefined-preprocessor|ptr-subtraction-blows|cast-to-address-space|decl|transparent-union|address-space|enum-mismatch|do-while)$/; + return 1 if $arg =~ /^-W(no-?)?(default-bitfield-sig|one-bit-signed-bitfield|cast-truncate|bitwise|typesign|context|undefined-preprocessor|ptr-subtraction-blows|cast-to-address-space|decl|transparent-union|address-space|enum-mismatch|do-while|old-initializer)$/; return 1 if $arg =~ /^-v(no-?)?(entry|dead)$/; return 0; } @@ -204,6 +204,7 @@ int Waddress_space = 1; int Wenum_mismatch = 1; int Wdo_while = 1; int Wuninitialized = 1; +int Wold_initializer = 1; int dbg_entry = 0; int dbg_dead = 0; @@ -352,6 +353,7 @@ static const struct warning { { "enum-mismatch", &Wenum_mismatch }, { "do-while", &Wdo_while }, { "uninitialized", &Wuninitialized }, + { "old-initializer", &Wold_initializer }, }; enum { @@ -101,6 +101,7 @@ extern int Wshadow; extern int Wcast_truncate; extern int Wdo_while; extern int Wuninitialized; +extern int Wold_initializer; extern int dbg_entry; extern int dbg_dead; @@ -1830,7 +1830,8 @@ static struct token *single_initializer(struct expression **ep, struct token *to if ((token_type(token) == TOKEN_IDENT) && match_op(next, ':')) { struct expression *expr = identifier_expression(token); - warning(token->pos, "obsolete struct initializer, use C99 syntax"); + if (Wold_initializer) + warning(token->pos, "obsolete struct initializer, use C99 syntax"); token = initializer(&expr->ident_expression, next->next); if (expr->ident_expression) *ep = expr; |
