cppinit.c (cpp_finish_options): Set first_unused_line to -1.
authorNeil Booth <neil@daikokuya.co.uk>
Sat, 8 Mar 2003 13:34:31 +0000 (13:34 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Sat, 8 Mar 2003 13:34:31 +0000 (13:34 +0000)
* cppinit.c (cpp_finish_options): Set first_unused_line to -1.
testsuite:
* gcc.dg/cpp/Wunused.c: Update test.

From-SVN: r63985

gcc/ChangeLog
gcc/cppinit.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/Wunused.c

index 2cfa10019901c665814e7d331417bcacb668a79d..0b788053bd45a0402abdfcceab67ef0df6ceab4c 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-08  Neil Booth  <neil@daikokuya.co.uk>
+
+       * cppinit.c (cpp_finish_options): Set first_unused_line to -1.
+
 2003-03-08  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/h8300/h8300.md (*extzv_16_8): New.
index 76b99b0079d90605231a4354dded9582b53a040d..5cbd87feec3e007fdf44a4dc9fbe0c80de044551 100644 (file)
@@ -625,6 +625,8 @@ cpp_finish_options (pfile)
     {
       struct pending_option *p;
 
+      /* Prevent -Wunused-macros with command-line redefinitions.  */
+      pfile->first_unused_line = (unsigned int) -1;
       _cpp_do_file_change (pfile, LC_RENAME, _("<built-in>"), 1, 0);
       init_builtins (pfile);
       _cpp_do_file_change (pfile, LC_RENAME, _("<command line>"), 1, 0);
index d44271e05024650a7f8bd7e6805090487e42a0ff..5d7b965d572338176b8034f8510fa822d511fcf6 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-08  Neil Booth  <neil@daikokuya.co.uk>
+
+       * gcc.dg/cpp/Wunused.c: Update test.
+
 Sat Mar  8 14:18:15 CET 2003  Jan Hubicka  <jh@suse.cz>
 
        * gcc.dg/inline-3.c: New test.
index aa099ee79c8cf3816a3693d63e862be083b5a75b..ac363ad04b8ecabc3ee828643a2c783808b9a224 100644 (file)
@@ -1,7 +1,8 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.  */
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.  */
 
 /* { dg-do preprocess } */
-/* { dg-options -Wunused-macros } */
+/* Duplicate command line options should not warn.  */
+/* { dg-options "-Wunused-macros -Dfoo -Dfoo" } */
 
 /* Test everything related to -Wunused-macros.