Browse Source

GCC warning -Wdate-time appeared first with gcc5

Do not try do disable it for gcc 4.8, which is still very popular
Sergey Linev 6 years ago
parent
commit
0eb103948e
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/civetweb.c

+ 5 - 1
src/civetweb.c

@@ -19046,10 +19046,12 @@ mg_get_system_info_impl(char *buffer, int buflen)
 	/* Build date */
 	{
 #if defined(GCC_DIAGNOSTIC)
+#if GCC_VERSION >= 50000
 #pragma GCC diagnostic push
-/* Disable bogus compiler warning -Wdate-time */
+/* Disable bogus compiler warning -Wdate-time, appeared in gcc5 */
 #pragma GCC diagnostic ignored "-Wdate-time"
 #endif
+#endif
 		mg_snprintf(NULL,
 		            NULL,
 		            block,
@@ -19059,8 +19061,10 @@ mg_get_system_info_impl(char *buffer, int buflen)
 		            eol);
 
 #if defined(GCC_DIAGNOSTIC)
+#if GCC_VERSION >= 50000
 #pragma GCC diagnostic pop
 #endif
+#endif
 
 		system_info_length += (int)strlen(block);
 		if (system_info_length < buflen) {