$OpenBSD: patch-examples_simple-publisher_c,v 1.1 2017/06/20 07:18:19 ajacoutot Exp $

error: #pragma GCC diagnostic not allowed inside functions

Index: examples/simple-publisher.c
--- examples/simple-publisher.c.orig
+++ examples/simple-publisher.c
@@ -38,10 +38,7 @@ timestamp_handler_date (EpcPublisher *publisher G_GNUC
   // Ignore the gcc warning:
   // error: ‘%x’ yields only last 2 digits of year in some locales [-Werror=format-y2k]
   // because there doesn't seem to be any way to show 4 digits in the correct format for the locale.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-y2k"
   length = strftime (buffer, length, "%x", tm);
-#pragma GCC diagnostic pop
 
   return epc_contents_new ("text/plain", buffer, length, g_free);
 }
@@ -81,10 +78,7 @@ timestamp_handler_date_time (EpcPublisher *publisher G
   // Ignore the gcc warning:
   // error: ‘%x’ yields only last 2 digits of year in some locales [-Werror=format-y2k]
   // because there doesn't seem to be any way to show 4 digits in the correct format for the locale.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-y2k"
   length = strftime (buffer, length, "%x %X", tm);
-#pragma GCC diagnostic pop
 
   return epc_contents_new ("text/plain", buffer, length, g_free);
 }
