From a94a477d07b369f653701b81c1f755b911ec0d5b Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 29 Jul 2010 04:11:23 +0200 Subject: [PATCH] * make-docfile.c (write_c_args): Warn for old-style empty arglist (). --- lib-src/ChangeLog | 4 ++++ lib-src/make-docfile.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index d0ab1087aa9..9650348a317 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,7 @@ +2010-07-29 Juanma Barranquero + + * make-docfile.c (write_c_args): Warn for old-style empty arglist (). + 2010-07-25 Juanma Barranquero * emacsclient.c (getcwd): Fix previous change: make getcwd diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 4b5012902a0..7fe63bed506 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -442,7 +442,7 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs) register char *p; int in_ident = 0; char *ident_start; - int ident_length; + int ident_length = 0; fprintf (out, "(fn"); @@ -476,6 +476,12 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs) 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; -- 2.39.2