Commit b41f25cf by Neil Booth Committed by Neil Booth

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
parent c2734e05
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
warnings on assertions.
......
......@@ -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.
......
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
......
......@@ -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
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment