changeset 109568:7af1a36b6b28

* make-docfile.c (write_c_args): Warn for old-style empty arglist ().
author Juanma Barranquero <lekktu@gmail.com>
date Thu, 29 Jul 2010 04:11:23 +0200
parents 0fc9f7a0d319
children 62aece7dd5af
files lib-src/ChangeLog lib-src/make-docfile.c
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Wed Jul 28 14:54:42 2010 -0400
+++ b/lib-src/ChangeLog	Thu Jul 29 04:11:23 2010 +0200
@@ -1,3 +1,7 @@
+2010-07-29  Juanma Barranquero  <lekktu@gmail.com>
+
+	* make-docfile.c (write_c_args): Warn for old-style empty arglist ().
+
 2010-07-25  Juanma Barranquero  <lekktu@gmail.com>
 
 	* emacsclient.c (getcwd): Fix previous change: make getcwd
--- a/lib-src/make-docfile.c	Wed Jul 28 14:54:42 2010 -0400
+++ b/lib-src/make-docfile.c	Thu Jul 29 04:11:23 2010 +0200
@@ -442,7 +442,7 @@
   register char *p;
   int in_ident = 0;
   char *ident_start;
-  int ident_length;
+  int ident_length = 0;
 
   fprintf (out, "(fn");
 
@@ -476,6 +476,12 @@
 	 identifier.  */
       if (c == ',' || c == ')')
 	{
+	  if (ident_length == 0)
+	    {
+	      error ("empty arg list for `%s' should be (void), not ()", func);
+	      continue;
+	    }
+
 	  if (strncmp (ident_start, "void", ident_length) == 0)
 	    continue;