diff --git a/ffserver.c b/ffserver.c
index 94a239ca5d35555c7b636298a730537dbc824c87..9a3240808b803ab498bb2f14de3018261ed9b773 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -384,7 +384,10 @@ static void http_vlog(const char *fmt, va_list vargs)
     }
 }
 
-static void __attribute__ ((format (printf, 1, 2))) http_log(const char *fmt, ...)
+#ifdef __GNUC__
+__attribute__ ((format (printf, 1, 2)))
+#endif
+static void http_log(const char *fmt, ...)
 {
     va_list vargs;
     va_start(vargs, fmt);