cppopts.texi: Update.

* doc/cppopts.texi: Update.
testsuite:
	* gcc.dg/cpp/trad/Wunused.c, gcc.dg/cpp/Wunused.c: Add test
	for documented behaviour.

From-SVN: r55779
This commit is contained in:
Neil Booth 2002-07-26 16:34:09 +00:00 committed by Neil Booth
parent c2734e0563
commit b41f25cf92
5 changed files with 32 additions and 1 deletions

View 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

View 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.

View 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

View File

@ -26,7 +26,12 @@
#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

View File

@ -26,6 +26,12 @@
#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