shithub: rgbds

Download patch

ref: 95ccc48d0c30380bfc4367f442f3fea1af75e79a
parent: 29253046d59b7ae944f8d9c9164e27228852b4cf
author: Antonio Niño Díaz <[email protected]>
date: Sun Apr 1 20:25:26 EDT 2018

Enable -Wundef

Signed-off-by: Antonio Niño Díaz <[email protected]>

--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@
 		   -Wunknown-pragmas -Wstrict-overflow=5 -Wstringop-overflow=4 \
 		   -Walloc-zero -Wduplicated-cond -Wfloat-equal -Wshadow \
 		   -Wcast-qual -Wcast-align -Wlogical-op -Wnested-externs \
-		   -Wno-aggressive-loop-optimizations -Winline \
+		   -Wno-aggressive-loop-optimizations -Winline -Wundef \
 		   -Wstrict-prototypes -Wold-style-definition
 
 # Overridable CFLAGS
--- a/include/extern/stdnoreturn.h
+++ b/include/extern/stdnoreturn.h
@@ -9,16 +9,28 @@
 #ifndef EXTERN_STDNORETURN_H
 #define EXTERN_STDNORETURN_H
 
-#if __STDC_VERSION__ >= 201112L
-	/* C11 or newer */
-	#define noreturn _Noreturn
-#elif __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ >= 5))
-	/* GCC 2.5 or newer */
-	#define noreturn __attribute__ ((noreturn))
-#elif _MSC_VER >= 1310
-	/* MS Visual Studio 2003/.NET Framework 1.1 or newer */
-	#define noreturn _declspec(noreturn)
-#else
+#if defined(__STDC_VERSION__)
+	#if __STDC_VERSION__ >= 201112L
+		/* C11 or newer */
+		#define noreturn _Noreturn
+	#endif
+#endif
+
+#if defined(__GNUC__) && !defined(noreturn)
+	#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ >= 5))
+		/* GCC 2.5 or newer */
+		#define noreturn __attribute__ ((noreturn))
+	#endif
+#endif
+
+#if defined(_MSC_VER) && !defined(noreturn)
+	#if _MSC_VER >= 1310
+		/* MS Visual Studio 2003/.NET Framework 1.1 or newer */
+		#define noreturn _declspec(noreturn)
+	#endif
+#endif
+
+#if !defined(noreturn)
 	/* Unsupported, but no need to throw a fit */
 	#define noreturn
 #endif