diff options
author | Stefan Eissing <icing@apache.org> | 2015-09-14 15:29:35 +0200 |
---|---|---|
committer | Stefan Eissing <icing@apache.org> | 2015-09-14 15:29:35 +0200 |
commit | ea390af213669bbc91ac1c0ddccea2f2ce610b43 (patch) | |
tree | 00322c881268f00b95e5e760013c3adf6f1e3f9e /include/http_config.h | |
parent | changing r->protocol to HTTP/2 for all directly handles requests, fixing hand... (diff) | |
download | apache2-ea390af213669bbc91ac1c0ddccea2f2ce610b43.tar.xz apache2-ea390af213669bbc91ac1c0ddccea2f2ce610b43.zip |
httpd compiles warning free on gcc and every new warning will be treated as an error, standard c-89 is enforced
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1702948 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/http_config.h')
-rw-r--r-- | include/http_config.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/include/http_config.h b/include/http_config.h index ad5ba2f9da..96d012fa4e 100644 --- a/include/http_config.h +++ b/include/http_config.h @@ -413,6 +413,23 @@ struct module_struct { }; /** + * The AP_MAYBE_USELESS macro is used vor variable declarations that + * might potentially exhibit "unused var" warnings on some compilers if + * left untreated. + * Since static intializers are not part of the C language (C89), making + * (void) usage is not possible. However many compiler have proprietary + * mechanism to suppress those warnings. + */ +#ifdef AP_MAYBE_USELESS +#elif defined(__GNUC__) +# define AP_MAYBE_USELESS(x) x __attribute__((unused)) +#elif defined(__LCLINT__) +# define AP_MAYBE_USELESS(x) /*@unused@*/ x +#else +# define AP_MAYBE_USELESS(x) x +#endif + +/** * The APLOG_USE_MODULE macro is used choose which module a file belongs to. * This is necessary to allow per-module loglevel configuration. * @@ -427,7 +444,7 @@ struct module_struct { */ #define APLOG_USE_MODULE(foo) \ extern module AP_MODULE_DECLARE_DATA foo##_module; \ - static int * const aplog_module_index = &(foo##_module.module_index) + AP_MAYBE_USELESS(static int * const aplog_module_index) = &(foo##_module.module_index) /** * AP_DECLARE_MODULE is a convenience macro that combines a call of |