This is an archive of the discontinued LLVM Phabricator instance.

Ensure ISL is always compiled with std=gnu99. NFC
AbandonedPublic

Authored by sgundapa on Dec 9 2015, 11:04 AM.

Details

Summary

With older versions of CMake<=3.1 and clang, fortify the logic
to ensure ISL is always compiled with "-std=gnu99"

Diff Detail

Event Timeline

sgundapa updated this revision to Diff 42322.Dec 9 2015, 11:04 AM
sgundapa retitled this revision from to Ensure ISL is always compiled with std=gnu99. NFC.
sgundapa updated this object.
sgundapa added reviewers: zinob, grosser, Meinersbur.
Meinersbur edited edge metadata.Dec 14 2015, 7:06 AM

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

grosser edited edge metadata.Dec 18 2015, 2:44 AM

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

grosser resigned from this revision.Jan 26 2016, 9:31 AM
grosser removed a reviewer: grosser.

Dropping out of this review. I suggest to abond this review for now and reopen it in case the bug can be reproduced.

sgundapa abandoned this revision.Jul 28 2017, 3:18 PM