aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1994-07-02 16:13:19 -0700
committerJim Wilson <wilson@gcc.gnu.org>1994-07-02 16:13:19 -0700
commitb8bdbf1625d565a15fe3e6838ce6bb9282aa1608 (patch)
tree277bc7cf64eb3c730fbb7f636443efb5b88b2038 /gcc/c-lex.c
parent1d00bef8190000500896d7433737b255999a907e (diff)
downloadgcc-b8bdbf1625d565a15fe3e6838ce6bb9282aa1608.zip
gcc-b8bdbf1625d565a15fe3e6838ce6bb9282aa1608.tar.gz
gcc-b8bdbf1625d565a15fe3e6838ce6bb9282aa1608.tar.bz2
(yylex): Reject imaginary numbers when pedantic.
From-SVN: r7646
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index d83f16a..17d50be 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -1330,6 +1330,8 @@ yylex ()
case 'i': case 'I':
if (imag)
error ("more than one `i' or `j' in numeric constant");
+ else if (pedantic)
+ pedwarn ("ANSI C forbids imaginary numeric constants");
imag = 1;
break;
@@ -1458,6 +1460,8 @@ yylex ()
{
if (spec_imag)
error ("more than one `i' or `j' in numeric constant");
+ else if (pedantic)
+ pedwarn ("ANSI C forbids imaginary numeric constants");
spec_imag = 1;
}
else