]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
(yylex): Reject imaginary numbers when pedantic.
authorJim Wilson <wilson@gcc.gnu.org>
Sat, 2 Jul 1994 23:13:19 +0000 (16:13 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Sat, 2 Jul 1994 23:13:19 +0000 (16:13 -0700)
From-SVN: r7646

gcc/c-lex.c

index d83f16a47c195f76e39c2fa407b6675eca7e067e..17d50bef181a12f1bc8eec1ec46da762fc1091d0 100644 (file)
@@ -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