]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cppopts.texi: Update.
authorNeil Booth <neil@daikokuya.co.uk>
Fri, 26 Jul 2002 16:34:09 +0000 (16:34 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Fri, 26 Jul 2002 16:34:09 +0000 (16:34 +0000)
* doc/cppopts.texi: Update.
testsuite:
* gcc.dg/cpp/trad/Wunused.c, gcc.dg/cpp/Wunused.c: Add test
for documented behaviour.

From-SVN: r55779

gcc/ChangeLog
gcc/doc/cppopts.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/Wunused.c
gcc/testsuite/gcc.dg/cpp/trad/Wunused.c

index 2dd43e6fe0f263634511218dec4d420c0514ced7..18e8f1cdd1527a4671fcd706c38a91d130cde07c 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-26  Neil Booth  <neil@daikokuya.co.uk>
+
+       * doc/cppopts.texi: Update.
+
 2002-07-26  Neil Booth  <neil@daikokuya.co.uk>
 
        * cppmacro.c (_cpp_create_definition): Don't attempt redefinition
index 24c6edd238d6b1b04953a86e0c97e173dd34e489..27b11cde2613bb28b4bf0a62f986fb3598ae77fc 100644 (file)
@@ -120,6 +120,17 @@ time it is redefined or undefined.
 Built-in macros, macros defined on the command line, and macros
 defined in include files are not warned about.
 
+@strong{Note:} If a macro is actually used, but only used in skipped
+conditional blocks, then CPP will report it as unused.  To avoid the
+warning in such a case, you might improve the scope of the macro's
+definition by, for example, moving it into the first skipped block.
+Alternatively, you could provide a dummy use with something like:
+
+@smallexample
+#if defined the_macro_causing_the_warning
+#endif
+@end smallexample
+
 @item -Wendif-labels
 @opindex Wendif-labels
 Warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
index ea6ed3934201c99a57e11acb34ad99f7e7ab6f15..cad29abf7be4d5595d7f05eece8ea0e47b4aa9e0 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-26  Neil Booth  <neil@daikokuya.co.uk>
+
+       * gcc.dg/cpp/trad/Wunused.c, gcc.dg/cpp/Wunused.c: Add test
+       for documented behaviour.
+
 2002-07-25  Roger Sayle  <roger@eyesopen.com>
 
        * gcc.c-torture/execute/20020720-1.x: Skip this test on
index f134f55a15946496461f221e019778323506abbb..aa099ee79c8cf3816a3693d63e862be083b5a75b 100644 (file)
 #endif
 used4
 
-unused7
+unused7                                /* This does not count as a use.  */
+
+#if 0
+unused5                                /* This does not count as a use.  */
+#endif
 #undef unused5
+
 #define unused6
 unused6
index fd81a27ecc7c315af6bc425e8a1f2c204a02254e..403d617f5d066978e080a347a7cb4a04c029072f 100644 (file)
 #endif
 used4
 
+unused7;                       /* This does not count as a use.  */
+
+#if 0
+unused5                                /* This does not count as a use.  */
+#endif
+
 #undef unused5
 #define unused6
 unused6