From 0fc9cea986134d5e8c50ae415d53ddd8e0cb91dc Mon Sep 17 00:00:00 2001 From: Evgueni Souleimanov Date: Mon, 16 Jun 2014 20:49:57 -0400 Subject: [PATCH] fix "warning: old-style function definition" This warning occurred when compiling using gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) on CentOS 6.5 x86_64 using the following CFLAGS (locally inserted into Makefile) CFLAGS = -g -Wall -Wextra -Wformat=2 -funsigned-char -fstrict-aliasing -Wstrict-aliasing -Wfloat-equal -Wundef -Wuninitialized -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Waddress -Waggregate-return -Wstrict-prototypes -Wold-style-declaration -Wold-style-definition -Wmissing-parameter-type -Wmissing-prototypes -Wmissing-declarations -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-format-attribute -Wpacked -Wredundant-decls -Wnested-externs -Wshadow -Wsign-compare -Wlogical-op -std=c99 and this make command: make clean ; make example tests --- example.c | 2 +- tests.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example.c b/example.c index 68fb873..0955be3 100644 --- a/example.c +++ b/example.c @@ -12,7 +12,7 @@ #include "minmea.h" -int main() +int main(void) { char line[MINMEA_MAX_LENGTH]; while (fgets(line, sizeof(line), stdin) != NULL) { diff --git a/tests.c b/tests.c index e5fd45b..a503c3c 100644 --- a/tests.c +++ b/tests.c @@ -754,7 +754,7 @@ Suite *minmea_suite(void) return s; } -int main() +int main(void) { int number_failed; Suite *s = minmea_suite();