This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Feature request PR14331: add -W(no-)eof-newline

    Hi gcc-patches@,



  Here's the patch as promised that implements the new warning option to
suppress the "No newline at end of file" warning message.  It's modelled on
the -Wendif-labels option, in particular the fact that -pedantic enables it
even if it's been turned off by an earlier option (and that a later option can
disable it again).

  It comes with documentation and testcases.  Bootstrapped and regtested on
x86_64-unknown-linux-gnu in C,C++ and Fortran, with no regressions, and
bootstrapped and tested for correctness on i686-pc-cygwin in C,C++ and

  Ok to checkin?


2007-04-10  Dave Korn  <>

	* doc/cppopts.texi: Document -Weof-newline.
	* doc/invoke.texi: Document -Wno-eof-newline.
	* c.opt: Add Weof-newline.
	* c-opts.c (c_common_handle_option):  Handle OPT_Weof_newline.


2007-04-10  Dave Korn  <>

	* gcc.dg/cpp/Wno-eof-newline.c, gcc.dg/cpp/Wno-eof-newline-2.c,
	gcc.dg/cpp/Wno-eof-newline.h, gcc.dg/cpp/Wno-eof-newline.c,
	gcc.dg/cpp/Wno-eof-newline-2.c, gcc.dg/cpp/Wno-eof-newline.h: New
	testcases for new warning flag.


2007-04-10  Dave Korn  <>

	* libcpp/include/cpplib.h (struct cpp_options): Add new struct
	member warn_eof_newline.
	* libcpp/init.c (cpp_create_reader): Default warn_eof_newline on.
	* libcpp/lex.c (_cpp_get_fresh_line): Suppress "no newline at end
	of file" warning if warn_eof_newline not set in reader options.

Can't think of a witty .sigline today....

Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]