Fixed more warnings

This commit is contained in:
Dale Weiler 2012-06-07 11:18:04 -04:00
parent 2929eb39a8
commit 15d4534202
2 changed files with 32 additions and 25 deletions

View file

@ -3,17 +3,16 @@ CFLAGS += -Wall -I. -pedantic-errors -std=c90
#turn on tons of warnings if clang is present #turn on tons of warnings if clang is present
ifeq ($(CC), clang) ifeq ($(CC), clang)
CFLAGS += \ CFLAGS += \
-Weverything \ -Weverything \
-Wno-missing-prototypes \ -Wno-missing-prototypes \
-Wno-unused-parameter \ -Wno-unused-parameter \
-Wno-sign-compare \ -Wno-sign-compare \
-Wno-implicit-fallthrough \ -Wno-implicit-fallthrough \
-Wno-sign-conversion \ -Wno-sign-conversion \
-Wno-conversion \ -Wno-conversion \
-Wno-disabled-macro-expansion \ -Wno-disabled-macro-expansion \
-Wno-padded \ -Wno-padded \
-Wno-undef \
-Wno-format-nonliteral -Wno-format-nonliteral
endif endif

38
gmqcc.h
View file

@ -53,12 +53,16 @@
# endif /* !true */ # endif /* !true */
# define false (0) # define false (0)
# define true (1) # define true (1)
# if __STDC_VERSION__ < 199901L && __GNUC__ < 3 # ifdef __STDC_VERSION__
typedef int _Bool # if __STDC_VERSION__ < 199901L && __GNUC__ < 3
typedef int bool;
# else
typedef _Bool bool;
# endif
# else # else
typedef _Bool bool; typedef int bool;
# endif # endif /* !__STDC_VERSION__ */
# endif /* !__cplusplus */ #endif /* !__cplusplus */
/* /*
* Of some functions which are generated we want to make sure * Of some functions which are generated we want to make sure
@ -81,19 +85,23 @@
* like gcc and clang might have an inline attribute we can * like gcc and clang might have an inline attribute we can
* use if present. * use if present.
*/ */
#if __STDC_VERSION__ < 199901L #ifdef __STDC_VERSION__
# if defined(__GNUC__) || defined (__CLANG__) # if __STDC_VERSION__ < 199901L
# if __GNUC__ < 2 # if defined(__GNUC__) || defined (__CLANG__)
# define GMQCC_INLINE # if __GNUC__ < 2
# define GMQCC_INLINE
# else
# define GMQCC_INLINE __attribute__ ((always_inline))
# endif
# else # else
# define GMQCC_INLINE __attribute__ ((always_inline)) # define GMQCC_INLINE
# endif # endif
# else # else
# define GMQCC_INLINE # define GMQCC_INLINE inline
# endif # endif
#else #else
# define GMQCC_INLINE inline # define GMQCC_INLINE
#endif #endif /* !__STDC_VERSION__ */
/* /*
* noreturn is present in GCC and clang * noreturn is present in GCC and clang