Commit 19504cad952e5714b00f23691ee7626cb5f1a0a2

Martin Mitas 2019-04-29T22:24:23

Revert "Build: With gcc and clang, enforce -std=c90." This reverts commit 716b6ca4448318df900eb22bb7a31499a827d905. Rationale: snprintf() not available in C90, so -std=c90 causes warnings on Linux.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ac7ede..12674d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,7 +34,7 @@ endif()
 
 
 if(${CMAKE_C_COMPILER_ID} MATCHES GNU|Clang)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=c90")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
 elseif(MSVC)
     # Disable warnings about the so-called unsecured functions:
     add_definitions(/D_CRT_SECURE_NO_WARNINGS)
diff --git a/md2html/render_html.c b/md2html/render_html.c
index e215f6e..9fc62f8 100644
--- a/md2html/render_html.c
+++ b/md2html/render_html.c
@@ -30,18 +30,14 @@
 #include "entity.h"
 
 
-/* Inline keyword has been added in C99. */
-#if __STDC_VERSION__ < 199901L
-    #if defined _MSC_VER
+#ifdef _MSC_VER
+    /* MSVC does not understand "inline" when building as pure C (not C++).
+     * However it understands "__inline" */
+    #ifndef __cplusplus
         #define inline __inline
-    #elif defined __GNUC__
-        #define inline __inline__
-    #else
-        #define inline
     #endif
 #endif
 
-
 #ifdef _WIN32
     #define snprintf _snprintf
 #endif
diff --git a/md4c/md4c.c b/md4c/md4c.c
index 138f06f..374331b 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -35,18 +35,14 @@
  ***  Miscellaneous Stuff  ***
  *****************************/
 
-/* Inline keyword has been added in C99. */
-#if __STDC_VERSION__ < 199901L
-    #if defined _MSC_VER
+#ifdef _MSC_VER
+    /* MSVC does not understand "inline" when building as pure C (not C++).
+     * However it understands "__inline" */
+    #ifndef __cplusplus
         #define inline __inline
-    #elif defined __GNUC__
-        #define inline __inline__
-    #else
-        #define inline
     #endif
 #endif
 
-
 #ifdef _T
     #undef _T
 #endif
@@ -1457,8 +1453,8 @@ abort:
  ***  Dictionary of Reference Definitions  ***
  *********************************************/
 
-#define MD_FNV1A_BASE       2166136261U
-#define MD_FNV1A_PRIME      16777619U
+#define MD_FNV1A_BASE       2166136261
+#define MD_FNV1A_PRIME      16777619
 
 static inline unsigned
 md_fnv1a(unsigned base, const void* data, size_t n)