From 97a2040637c845c160138d08fe9c8467baa02174 Mon Sep 17 00:00:00 2001 From: Silvio Fricke Date: Mon, 15 May 2017 10:34:20 +0200 Subject: [PATCH] FIXED: compiling with older gcc and used c standard MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) 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) -- 2.40.0