From 8e48d7bc3fef6ca11af98c12d99426bd01a5b3de Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 1 Apr 2011 13:28:50 -0700 Subject: [PATCH] * make-docfile.c (IF_LINT): New macro, copied from emacsclient.c. (write_c_args): Use it to suppress GCC warning. --- lib-src/ChangeLog | 5 +++++ lib-src/make-docfile.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 5007995e14e..78548ee6870 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2011-04-01 Paul Eggert + + * make-docfile.c (IF_LINT): New macro, copied from emacsclient.c. + (write_c_args): Use it to suppress GCC warning. + 2011-03-30 Paul Eggert Fix a problem found by GCC 4.6.0's static checks. diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index f900ea42e91..9b804684a12 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -66,6 +66,13 @@ along with GNU Emacs. If not, see . */ #define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) #endif +/* Use this to suppress gcc's `...may be used before initialized' warnings. */ +#ifdef lint +# define IF_LINT(Code) Code +#else +# define IF_LINT(Code) /* empty */ +#endif + static int scan_file (char *filename); static int scan_lisp_file (const char *filename, const char *mode); static int scan_c_file (char *filename, const char *mode); @@ -481,7 +488,7 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs) { register char *p; int in_ident = 0; - char *ident_start; + char *ident_start IF_LINT (= NULL); size_t ident_length = 0; fprintf (out, "(fn"); -- 2.39.2