gcc/gcc cppexp.c cpphash.h cppinit.c cpplib.c ...

neil@gcc.gnu.org neil@gcc.gnu.org
Tue Jul 23 15:57:00 GMT 2002


CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	neil@gcc.gnu.org	2002-07-23 15:57:50

Modified files:
	gcc            : cppexp.c cpphash.h cppinit.c cpplib.c cpplib.h 
	                 cppmacro.c cpptrad.c ChangeLog 
	gcc/doc        : cppopts.texi 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg/cpp: Wunused.c Wunused.h 
	gcc/testsuite/gcc.dg/cpp/trad: Wunused.c Wunused.h 

Log message:
	* cppexp.c (parse_defined): Mark macro used.
	* cpphash.h (struct cpp_macro): New member "used".
	(_cpp_mark_macro_used, _cpp_warn_if_unused_macro): New.
	(struct cpp_reader): New member.
	* cppinit.c (cpp_finish_options): Set first_unused_line.
	(cpp_finish): Warn of unused macros if requested.
	(OPT_TABLE): New switches.
	(cpp_handle_option): Handle them.
	* cpplib.c (do_undef): Warn if macro unused.
	(do_ifdef, do_ifndef): Mark macro used.
	* cpplib.h (struct cpp_options): New member.
	* cppmacro.c (_cpp_warn_if_unused_macro): New.
	(enter_macro_context): Mark macro used.
	(_cpp_create_definition): Mark macro unused; warn if unused
	when redefined.
	* cpptrad.c (scan_out_logcial_line, push_replacement_text):
	Mark macros used.
	* doc/cppopts.texi: Update.
	testsuite:
	* gcc.dg/cpp/trad/Wunused.c, gcc.dg/cpp/trad/Wunused.h,
	gcc.dg/cpp/Wunused.c, gcc.dg/cpp/Wunused.h: New tests.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cppexp.c.diff?cvsroot=gcc&r1=1.129&r2=1.130
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpphash.h.diff?cvsroot=gcc&r1=1.167&r2=1.168
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cppinit.c.diff?cvsroot=gcc&r1=1.245&r2=1.246
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpplib.c.diff?cvsroot=gcc&r1=1.319&r2=1.320
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpplib.h.diff?cvsroot=gcc&r1=1.226&r2=1.227
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cppmacro.c.diff?cvsroot=gcc&r1=1.117&r2=1.118
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpptrad.c.diff?cvsroot=gcc&r1=1.26&r2=1.27
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.14942&r2=1.14943
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/cppopts.texi.diff?cvsroot=gcc&r1=1.8&r2=1.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/cpp/Wunused.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/cpp/Wunused.h.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/cpp/trad/Wunused.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/cpp/trad/Wunused.h.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.1997&r2=1.1998



More information about the Gcc-cvs mailing list