aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-02-14 07:38:20 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-02-14 07:38:20 +0000
commit7065e130e02c335c37f44874a83c4cbf59dfea89 (patch)
tree5dc2a18484a5feaa3e30f77dadcb35f5c4945fc5 /gcc/c-lex.c
parent52682a1b7720c9f2d8528c3498631636f09ebd90 (diff)
downloadgcc-7065e130e02c335c37f44874a83c4cbf59dfea89.zip
gcc-7065e130e02c335c37f44874a83c4cbf59dfea89.tar.gz
gcc-7065e130e02c335c37f44874a83c4cbf59dfea89.tar.bz2
c-lex.c (lex_number): Only warn traditionally for U suffix outside system macros.
* c-lex.c (lex_number): Only warn traditionally for U suffix outside system macros. * cppexp.c (parse_number): Similarly. * cpplib.h (NODE_SYSHDR, cpp_sys_objmacro_p): New. * cppmacro.c (struct cpp_macro): New member node. (parse_args): Only warn about missing rest args if not a system macro. (funlike_invocation_p): Similarly for uninvoked funlike macros. (cpp_sys_objmacro_p): New. (_cpp_create_definition): Store the node with the macro defn. Remember if the macro is defined in a system header. From-SVN: r39661
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 358e5d1..c147648 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -1225,7 +1225,8 @@ lex_number (str, len)
case 'f': case 'F':
if (fflag)
ERROR ("more than one 'f' suffix on floating constant");
- else if (warn_traditional && !in_system_header)
+ else if (warn_traditional && !in_system_header
+ && ! cpp_sys_objmacro_p (parse_in))
warning ("traditional C rejects the 'f' suffix");
fflag = 1;
@@ -1234,7 +1235,8 @@ lex_number (str, len)
case 'l': case 'L':
if (lflag)
ERROR ("more than one 'l' suffix on floating constant");
- else if (warn_traditional && !in_system_header)
+ else if (warn_traditional && !in_system_header
+ && ! cpp_sys_objmacro_p (parse_in))
warning ("traditional C rejects the 'l' suffix");
lflag = 1;
@@ -1309,7 +1311,8 @@ lex_number (str, len)
case 'u': case 'U':
if (spec_unsigned)
error ("two 'u' suffixes on integer constant");
- else if (warn_traditional && !in_system_header)
+ else if (warn_traditional && !in_system_header
+ && ! cpp_sys_objmacro_p (parse_in))
warning ("traditional C rejects the 'u' suffix");
spec_unsigned = 1;