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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
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)