From: Silvio Fricke Date: Mon, 15 May 2017 08:34:20 +0000 (+0200) Subject: FIXED: compiling with older gcc and used c standard X-Git-Tag: 6.0.6^2~10^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97a2040637c845c160138d08fe9c8467baa02174;p=multimarkdown FIXED: compiling with older gcc and used c standard With "gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4" we get the failure Scanning dependencies of target libMultiMarkdown [ 3%] Building C object CMakeFiles/libMultiMarkdown.dir/Sources/libMultiMarkdown/aho-corasick.c.o /MultiMarkdown-6/Sources/libMultiMarkdown/aho-corasick.c: In function ‘ac_trie_node_prepare’: /MultiMarkdown-6/Sources/libMultiMarkdown/aho-corasick.c:283:2: error: ‘for’ loop initial declarations are only allowed in C99 mode for (int i = 0; i < 256; ++i) ^ [...] Signed-off-by: Silvio Fricke --- diff --git a/CMakeLists.txt b/CMakeLists.txt index cb9ac71..b09b664 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,8 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # using Clang # Default is 256 -- needed for localization hash function add_definitions("-fbracket-depth=264") +else() + add_definitions("-std=c99") endif() set(CMAKE_SUPPRESS_REGENERATION 1)