With older versions of CMake<=3.1 and clang, fortify the logic
to ensure ISL is always compiled with "-std=gnu99"
Details
- Reviewers
Meinersbur • zinob
Diff Detail
Event Timeline
If I am correct clang's default is -std=gnu11, and has never not accepted C99 by default. Is there another reason for this change?
I had issues compiling ISL with host clang-3.4 and an older cmake some time back.
With this logic, my compilation went fine.
I lookup up the source code for clang 3.4 (since I was curious) and its default dialect for (IK_Asm, IK_PreprocessedC, IK_ObjC, IK_PreprocessedObjC) is LangStandard::lang_gnu99. According to that, this patch shouldn't change anything.
I see another problem. According to https://cmake.org/cmake/help/v3.1/prop_tgt/C_STANDARD.html, C_STANDARD is supported by cmake 3.1, but I cant' find a "VERSION_GREATER_OR_EQUAL" operator.
I lost track of the original problem which I had seen some time back.
I am sure, if you use cmake-2.8 and clang-3.4 you will find a compilation error with isl.
It is possible , isl might have moved from what I have seen earlier.
If it is redundant, lets abandon this patch
Hi,
I also do not see how this patch could help. As Michael said, clang should already default to C99 (and did since the very beginning).
sgundapa, as you seem to know how to reproduce the bug, it would be great if you could do so and see what command line flags isl is compiled with in your buggy configuration. Unlikely, but maybe older versions of cmake reset the C mode to C89? Given these command line options, we can then try to reproduce the bug locally.
Best,
Tobias
Dropping out of this review. I suggest to abond this review for now and reopen it in case the bug can be reproduced.