diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2000-08-10 15:21:18 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2000-08-10 15:21:18 +0000 |
commit | 7da92c086fa7008497a8f959418c7ce05e048d24 (patch) | |
tree | 30a07535a16520798c29038412313aa0bf2aecde /gcc/c-lex.c | |
parent | b498d041faed872eb206182e619ebcc22327a2c9 (diff) | |
download | gcc-7da92c086fa7008497a8f959418c7ce05e048d24.zip gcc-7da92c086fa7008497a8f959418c7ce05e048d24.tar.gz gcc-7da92c086fa7008497a8f959418c7ce05e048d24.tar.bz2 |
c-lex.c (parse_float, yylex): For -Wtraditional, issue a warning about non-traditional numeric constant suffixes.
* c-lex.c (parse_float, yylex): For -Wtraditional, issue a
warning about non-traditional numeric constant suffixes.
* cppexp.c (parse_number): Likewise.
* invoke.texi: (-Wtraditional): Document new behavior.
From-SVN: r35607
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r-- | gcc/c-lex.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 9cbbc4d..77442e3 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -1109,12 +1109,16 @@ parse_float (data) case 'f': case 'F': if (fflag) error ("more than one `f' in numeric constant"); + else if (warn_traditional && !in_system_header) + warning ("traditional C rejects the `%c' suffix", args->c); fflag = 1; break; case 'l': case 'L': if (lflag) error ("more than one `l' in numeric constant"); + else if (warn_traditional && !in_system_header) + warning ("traditional C rejects the `%c' suffix", args->c); lflag = 1; break; @@ -1773,6 +1777,8 @@ yylex () { if (spec_unsigned) error ("two `u's in integer constant"); + else if (warn_traditional && !in_system_header) + warning ("traditional C rejects the `%c' suffix", c); spec_unsigned = 1; if (spec_long) suffix_lu = 1; |