diff --git a/configure.ac b/configure.ac index 6477ec1..9766467 100644 --- a/configure.ac +++ b/configure.ac @@ -233,6 +233,23 @@ then ) fi +CFLAGS="$cstd -Wmissing-prototypes -Werror" +AC_MSG_CHECKING([whether CC supports -Wmissing-prototypes]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [AC_MSG_RESULT([yes])] + [cstd="$cstd -Wmissing-prototypes"], + [AC_MSG_RESULT([no])] +) + +# XXX AC_LANG_PROGRAM produces unsuitable prototype so this check must be last one +CFLAGS="$cstd -Wstrict-prototypes -Werror" +AC_MSG_CHECKING([whether CC supports -Wstrict-prototypes]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])], + [AC_MSG_RESULT([yes])] + [cstd="$cstd -Wstrict-prototypes"], + [AC_MSG_RESULT([no])] +) + CFLAGS="$oldcflags" AC_ARG_ENABLE([binfilterlen], diff --git a/ed25519/ed25519.h b/ed25519/ed25519.h index d0c4491..f59760f 100644 --- a/ed25519/ed25519.h +++ b/ed25519/ed25519.h @@ -36,7 +36,7 @@ static const ge_cached ge_eightpoint = { 11267669, -24569594, 14624995 } }; -inline static void ge_initeightpoint() {} +inline static void ge_initeightpoint(void) {} #endif @@ -105,7 +105,7 @@ static const ge25519_pniels ge_eightpoint = { // t2d {{ 1700965895112270, 372560131616985, 329575203620664, 756160485635107, 981466775886086 }}, }; -inline static void ge_initeightpoint() {} +inline static void ge_initeightpoint(void) {} #endif @@ -129,7 +129,7 @@ static const ge25519_pniels ge_eightpoint = { // t2d {{ 9713713562319586894U, 4328467261753610859U, 8262494979546083277U, 4020087914029409631U }}, }; -inline static void ge_initeightpoint() {} +inline static void ge_initeightpoint(void) {} #endif @@ -232,7 +232,7 @@ static u8 fe_t2d[32] = { }; // initialize from packed representation -static void ge_initeightpoint() +static void ge_initeightpoint(void) { memset(&ge_eightpoint,0,sizeof(ge_eightpoint)); curve25519_expand(ge_eightpoint.ysubx,fe_ysubx); diff --git a/filters.h b/filters.h index ffd4c75..71f0118 100644 --- a/filters.h +++ b/filters.h @@ -92,4 +92,5 @@ extern struct pfiltervec filters; extern int flattened; extern void filters_init(void); +extern void filters_add(const char *filter); extern size_t filters_count(void); diff --git a/main.c b/main.c index 8f3cdd7..355f935 100644 --- a/main.c +++ b/main.c @@ -114,14 +114,14 @@ static void printhelp(FILE *out,const char *progname) fflush(out); } -static void e_additional() +static void e_additional(void) { fprintf(stderr,"additional argument required\n"); exit(1); } #ifndef STATISTICS -static void e_nostatistics() +static void e_nostatistics(void) { fprintf(stderr,"statistics support not compiled in\n"); exit(1); diff --git a/yaml.c b/yaml.c index 1f9e983..ebe03ab 100644 --- a/yaml.c +++ b/yaml.c @@ -49,12 +49,12 @@ static const char keys_field_time[] = "time: "; static pthread_mutex_t tminfo_mutex; -void yamlout_init() +void yamlout_init(void) { pthread_mutex_init(&tminfo_mutex,0); } -void yamlout_clean() +void yamlout_clean(void) { pthread_mutex_destroy(&tminfo_mutex); } diff --git a/yaml.h b/yaml.h index 0dc75d5..ca356c5 100644 --- a/yaml.h +++ b/yaml.h @@ -1,4 +1,4 @@ -extern void yamlout_init(); -extern void yamlout_clean(); +extern void yamlout_init(void); +extern void yamlout_clean(void); extern void yamlout_writekeys(const char *hostname,const u8 *formated_public,const u8 *formated_secret); extern int yamlin_parseandcreate(FILE *fin,char *sname,const char *hostname);