diff --git a/Makefile b/Makefile index 7c2cf7a..38c8704 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # the terms of the Do What The Fuck You Want To Public License, Version 2, as # published by Sam Hocevar. See the COPYING file for more details. -CFLAGS = -g -Wall -Wextra -Werror +CFLAGS = -g -Wall -Wextra -Werror -std=c99 LDFLAGS = -lcheck all: scan-build test example diff --git a/minmea.h b/minmea.h index 1caa0b3..8fab9c0 100644 --- a/minmea.h +++ b/minmea.h @@ -9,6 +9,8 @@ #ifndef MINMEA_H #define MINMEA_H +#define _BSD_SOURCE + #ifdef __cplusplus extern "C" { #endif diff --git a/tests.c b/tests.c index 8ec9e3a..cee01b1 100644 --- a/tests.c +++ b/tests.c @@ -6,6 +6,8 @@ * published by Sam Hocevar. See the COPYING file for more details. */ +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" + #include #include #include @@ -353,7 +355,7 @@ START_TEST(test_minmea_parse_rmc1) { const char *sentence = "$GPRMC,081836.75,A,3751.65,S,14507.36,E,000.0,360.0,130998,011.3,E"; struct minmea_sentence_rmc frame = {}; - struct minmea_sentence_rmc expected = { + static const struct minmea_sentence_rmc expected = { .time = { 8, 18, 36, 750000 }, .valid = true, .latitude = -375165, @@ -378,7 +380,7 @@ START_TEST(test_minmea_parse_rmc2) { const char *sentence = "$GPRMC,,A,3751.65,N,14507.36,W,,,,,"; struct minmea_sentence_rmc frame = {}; - struct minmea_sentence_rmc expected = { + static const struct minmea_sentence_rmc expected = { .time = { -1, -1, -1, -1 }, .valid = true, .latitude = 375165, @@ -397,7 +399,7 @@ START_TEST(test_minmea_parse_gga1) { const char *sentence = "$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47"; struct minmea_sentence_gga frame = {}; - struct minmea_sentence_gga expected = { + static const struct minmea_sentence_gga expected = { .time = { 12, 35, 19, 0 }, .latitude = 4807038, .latitude_scale = 1000, @@ -425,7 +427,7 @@ START_TEST(test_minmea_parse_gsa1) { const char *sentence = "$GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39"; struct minmea_sentence_gsa frame = {}; - struct minmea_sentence_gsa expected = { + static const struct minmea_sentence_gsa expected = { .mode = MINMEA_GPGSA_MODE_AUTO, .fix_type = MINMEA_GPGSA_FIX_3D, .sats = { 4, 5, 0, 9, 12, 0, 0, 24, 0, 0, 0, 0 },