OSDN Git Service

* c-parse.in (string): For -Wtraditional, warn about string
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 27 Jul 2000 15:35:32 +0000 (15:35 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 27 Jul 2000 15:35:32 +0000 (15:35 +0000)
concatenation only once per line.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35290 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-parse.in

index 10c5acf..36f246c 100644 (file)
@@ -1,3 +1,8 @@
+2000-07-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * c-parse.in (string): For -Wtraditional, warn about string
+       concatenation only once per line.
+
 Thu Jul 27 09:25:17 2000  Akiko Matsushita  <matusita@sra.co.jp>
 
        * pa/x-pa-hpux: Add -D_HIUX_SOURCE to FIXPROTO_DEFINES
index 87dfceb..b516ddf 100644 (file)
@@ -733,10 +733,21 @@ end ifobjc
 string:
          STRING
        | string STRING
-               { $$ = chainon ($1, $2);
+               {
+ifc
+                  static int last_lineno = 0;
+                  static const char *last_input_filename = 0;
+end ifc
+                  $$ = chainon ($1, $2);
 ifc
-                 if (warn_traditional && !in_system_header)
-                   warning ("Use of ANSI string concatenation");
+                 if (warn_traditional && !in_system_header
+                     && (lineno != last_lineno || !last_input_filename ||
+                         strcmp (last_input_filename, input_filename)))
+                   {
+                     warning ("traditional C rejects string concatenation");
+                     last_lineno = lineno;
+                     last_input_filename = input_filename;
+                   }
 end ifc
                }
        ;