View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014339CMakeModulespublic2013-08-04 06:532014-10-06 10:33
ReporterRolf Eike Beer 
Assigned ToRolf Eike Beer 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.11.2 
Target VersionCMake 3.0Fixed in VersionCMake 3.0 
Summary0014339: CheckCXXCompilerFlag seems to have problems with XL and BCC
Descriptionhttp://open.cdash.org/testDetails.php?test=202113167&build=2987847 [^]
http://open.cdash.org/testDetails.php?test=202039283&build=2987228 [^]

In both cases I doubt that "-std=cxx11" is a valid compiler flag, so this shouldn't have been detected as valid.
TagsNo tags attached.
Attached Filesdiff file icon check_regex.diff [^] (941 bytes) 2013-08-08 16:54 [Show Content]

 Relationships

  Notes
(0033665)
Brad King (manager)
2013-08-05 09:28

This module is inherently difficult to implement and cannot be guaranteed. Every compiler behaves differently w.r.t. unknown compiler flags, and the behavior is often dependent on the flag.

In this case:

$ xlc -std=cxx11 foo.c
xlc: 1501-210 (W) command option t contains an incorrect subargument
...

>bcc32 -std=cxx11 foo.c
(no complaint)

but for another bogus option:

$ xlc -1 foo.c
xlc: 1501-216 (W) command option -1 is not recognized - passed to ld
ld: 0706-012 The -1 flag is not recognized.

>bcc32 -1 foo.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
Error E2075: Incorrect command line option: -1
(0033684)
Brad King (manager)
2013-08-08 11:01

The wcl386 compiler help shows

 -st touch stack through SS first

and using -std=cxx11 results in

 Error! E059: unable to open 'd=c++11'
(0033687)
Rolf Eike Beer (developer)
2013-08-08 16:52

The difficulty of this makes it even more important that we get this right, the average user will have even more problems to get this right and will even less likely have the possibility to check this on different compilers.
(0033688)
Rolf Eike Beer (developer)
2013-08-08 17:51

Pushed my patch to next, this will hopefully fix at least the XL misdetection.
(0033691)
Brad King (manager)
2013-08-09 08:43

Thanks for working on this. While at it, please ensure that the C and CXX modules are maintained together. Actually perhaps some refactoring is in order as the two are almost identical and repeat the matching expressions. The only language-specific expression is the "...but not for C" for GNU.
(0033692)
Brad King (manager)
2013-08-09 08:44

The problem with these modules in general is that the detection needs to be flag-specific. Just because a compiler accepts a flag without error does not mean it does what the project expects. The modules' documentation should be updated to mention this caveat.
(0033695)
Rolf Eike Beer (developer)
2013-08-10 15:31

I have pushed the topic "cxx-flags" to next which merges most of the pattern.
(0033696)
Rolf Eike Beer (developer)
2013-08-10 15:32

Did you really mean to set this to backlog?
(0033697)
Rolf Eike Beer (developer)
2013-08-10 15:35

How about adding this text at the end of the doc for both modules:

# The result only tells that the compiler does not give an error message when
# it encounters the flag. If the flag has any effect or even a specific one is
# beyond the scope of this module.
(0033705)
Brad King (manager)
2013-08-13 09:40

Re 0014339:0033695: The topic includes this hunk:

+function (CHECK_CXX_COMPILER_FLAG_COMMON_PATTERNS _VAR)
+ include(${CMAKE_CURRENT_LIST_DIR}/CheckCCompilerFlag.cmake)

Including a file from inside a function has funky scoping rules, so please avoid doing so in this case.

Re 0014339:0033697: Yes, that documentation disclaimer looks good.
(0033707)
Rolf Eike Beer (developer)
2013-08-13 09:53

That include from inside the function was intentional to avoid the check_c_* stuff from being visible to the outside when anyone includes check_cxx_*. The idea was to force people to still include check_c_* if they need it and not accidentially get it from check_cxx_*.
(0033708)
Brad King (manager)
2013-08-13 09:58

Re 0014339:0033707: Instead move the common patterns to a separate detail module that is not publicly documented and include that from both.
(0033709)
Rolf Eike Beer (developer)
2013-08-13 15:19

Ok, done. From my side I think the topic can be merged now.
(0036953)
Robert Maynard (manager)
2014-10-06 10:33

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-08-04 06:53 Rolf Eike Beer New Issue
2013-08-05 09:28 Brad King Note Added: 0033665
2013-08-05 09:28 Brad King Status new => backlog
2013-08-08 11:01 Brad King Note Added: 0033684
2013-08-08 16:52 Rolf Eike Beer Note Added: 0033687
2013-08-08 16:53 Rolf Eike Beer File Added: check_regex.diff
2013-08-08 16:54 Rolf Eike Beer File Deleted: check_regex.diff
2013-08-08 16:54 Rolf Eike Beer File Added: check_regex.diff
2013-08-08 17:51 Rolf Eike Beer Note Added: 0033688
2013-08-09 08:43 Brad King Note Added: 0033691
2013-08-09 08:44 Brad King Note Added: 0033692
2013-08-10 15:31 Rolf Eike Beer Note Added: 0033695
2013-08-10 15:32 Rolf Eike Beer Note Added: 0033696
2013-08-10 15:35 Rolf Eike Beer Note Added: 0033697
2013-08-13 09:40 Brad King Note Added: 0033705
2013-08-13 09:41 Brad King Assigned To => Rolf Eike Beer
2013-08-13 09:41 Brad King Status backlog => assigned
2013-08-13 09:53 Rolf Eike Beer Note Added: 0033707
2013-08-13 09:58 Brad King Note Added: 0033708
2013-08-13 15:19 Rolf Eike Beer Note Added: 0033709
2014-03-25 17:53 Rolf Eike Beer Status assigned => resolved
2014-03-25 17:53 Rolf Eike Beer Resolution open => fixed
2014-03-25 17:53 Rolf Eike Beer Fixed in Version => CMake 3.0
2014-03-25 17:53 Rolf Eike Beer Target Version => CMake 3.0
2014-10-06 10:33 Robert Maynard Note Added: 0036953
2014-10-06 10:33 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team