diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2000-08-21 14:54:28 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2000-08-21 14:54:28 +0000 |
commit | cde6e6843d0521cc837be3d5154be6c3ab93a254 (patch) | |
tree | 567643882a164b0c7c6014faac6840e3404eb29e /gcc | |
parent | 120dc6cd25a52db6221ea7ccf1a07acea21d3a02 (diff) | |
download | gcc-cde6e6843d0521cc837be3d5154be6c3ab93a254.zip gcc-cde6e6843d0521cc837be3d5154be6c3ab93a254.tar.gz gcc-cde6e6843d0521cc837be3d5154be6c3ab93a254.tar.bz2 |
c-decl.c (duplicate_decls, [...]): Restrict -Wtraditional warnings to user code.
* c-decl.c (duplicate_decls, define_label): Restrict -Wtraditional
warnings to user code.
* c-lex.c (readescape, yylex): Likewise.
* c-typeck.c (store_init_value, process_init_element): Likewise
(c_expand_start_case): Format.
From-SVN: r35845
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/c-decl.c | 4 | ||||
-rw-r--r-- | gcc/c-lex.c | 6 | ||||
-rw-r--r-- | gcc/c-typeck.c | 7 |
4 files changed, 18 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2ef3cea..8172c6f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2000-08-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * c-decl.c (duplicate_decls, define_label): Restrict -Wtraditional + warnings to user code. + + * c-lex.c (readescape, yylex): Likewise. + + * c-typeck.c (store_init_value, process_init_element): Likewise + (c_expand_start_case): Format. + 2000-08-18 Maciej W. Rozycki <macro@ds2.pg.gda.pl> * mips/linux.h (LINK_SPEC): Use %(endian_spec). diff --git a/gcc/c-decl.c b/gcc/c-decl.c index c9afb28..17b131a 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1760,7 +1760,7 @@ duplicate_decls (newdecl, olddecl, different_binding_level) /* If warn_traditional, warn when a non-static function declaration follows a static one. */ - if (warn_traditional + if (warn_traditional && !in_system_header && TREE_CODE (olddecl) == FUNCTION_DECL && !TREE_PUBLIC (olddecl) && TREE_PUBLIC (newdecl)) @@ -2751,7 +2751,7 @@ define_label (filename, line, name) decl = lookup_label (name); } - if (warn_traditional && lookup_name (name)) + if (warn_traditional && !in_system_header && lookup_name (name)) warning ("traditional C lacks a separate namespace for labels, identifier `%s' conflicts", IDENTIFIER_POINTER (name)); diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 77442e3..c1b85c7 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -902,7 +902,7 @@ readescape (ignore_ptr) switch (c) { case 'x': - if (warn_traditional) + if (warn_traditional && !in_system_header) warning ("the meaning of `\\x' varies with -traditional"); if (flag_traditional) @@ -987,7 +987,7 @@ readescape (ignore_ptr) return TARGET_BS; case 'a': - if (warn_traditional) + if (warn_traditional && !in_system_header) warning ("the meaning of `\\a' varies with -traditional"); if (flag_traditional) @@ -1912,7 +1912,7 @@ yylex () /* We assume that constants specified in a non-decimal base are bit patterns, and that the programmer really meant what they wrote. */ - if (warn_traditional && base == 10 + if (warn_traditional && !in_system_header && base == 10 && traditional_type != ansi_type) { if (TYPE_PRECISION (traditional_type) diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 8459f47..9cd27e5 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4396,7 +4396,7 @@ store_init_value (decl, init) } #endif - if (warn_traditional + if (warn_traditional && !in_system_header && AGGREGATE_TYPE_P (TREE_TYPE (decl)) && ! TREE_STATIC (decl)) warning ("traditional C rejects automatic aggregate initialization"); @@ -6400,7 +6400,7 @@ process_init_element (value) code appears conditioned on e.g. __STDC__ to avoid "missing initializer" warnings and relies on default initialization to zero in the traditional C case. */ - if (warn_traditional && !integer_zerop (value)) + if (warn_traditional && !in_system_header && !integer_zerop (value)) warning ("traditional C rejects initialization of unions"); /* Accept a string constant to initialize a subarray. */ @@ -6739,8 +6739,7 @@ c_expand_start_case (exp) tree index; type = TYPE_MAIN_VARIANT (TREE_TYPE (exp)); - if (warn_traditional - && ! in_system_header + if (warn_traditional && !in_system_header && (type == long_integer_type_node || type == long_unsigned_type_node)) warning ("`long' switch expression not converted to `int' in ISO C"); |