This is the mail archive of the gcc@gcc.gnu.org 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]

Re: error: "no newline at end of file"


We have some real numbers about these new errors now.  I've compiled
the whole Debian archive in the last week for Gelato to test GCC 4.3
on IA64.  Out of just slightly under 7000 packages in Debian, we have
the following new failures:

missing newline: 42
error: "xxx" redefined: 33
extra tokens at end of #else directive: 9

undefined reference: because of the change of the meaning of "inline": 4
multiple definition: probably due to the change of "inline", linking
against:
 Apache: 1
 libc6: 12
 glib: 11

C++ header cleanup: 370 (I'll start filing bugs on packages...)
first argument of 'int main(unsigned int, char* const*)' should be 'int: 3
error: changes meaning of: 68
bugs I still need to investigate: 77

With regards to the pedwarnings, I suggest the following:

 - The "no newline" and "xxx redfined" pedwarnings should be converted
   into normal warnings.  Rationale: no newline doesn't harm anyone and
   there are quite a few programs that would fail because of an error
   that many agree is too strict.  Redefining something with -D seems
   like an useful feature and again quite a few applications do this.
 - "extra tokens at end of #else directive": this is easy enough to
   fix and only few programs do this.  Let's keep this is as a pedwarn.

If people agree, I'll check in the following patch.  OK?

Index: libcpp/macro.c
===================================================================
--- libcpp/macro.c	(revision 123380)
+++ libcpp/macro.c	(working copy)
@@ -1622,11 +1622,11 @@
 
       if (warn_of_redefinition (pfile, node, macro))
 	{
-	  cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->directive_line, 0,
+	  cpp_error_with_line (pfile, CPP_DL_WARN, pfile->directive_line, 0,
 			       "\"%s\" redefined", NODE_NAME (node));
 
 	  if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN))
-	    cpp_error_with_line (pfile, CPP_DL_PEDWARN,
+	    cpp_error_with_line (pfile, CPP_DL_WARN,
 				 node->value.macro->line, 0,
 			 "this is the location of the previous definition");
 	}
Index: libcpp/lex.c
===================================================================
--- libcpp/lex.c	(revision 123380)
+++ libcpp/lex.c	(working copy)
@@ -854,7 +854,7 @@
 	{
 	  /* Only warn once.  */
 	  buffer->next_line = buffer->rlimit;
-	  cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line_table->highest_line,
+	  cpp_error_with_line (pfile, CPP_DL_WARN, pfile->line_table->highest_line,
 			       CPP_BUF_COLUMN (buffer, buffer->cur),
 			       "no newline at end of file");
 	}

-- 
Martin Michlmayr
http://www.cyrius.com/


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