MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0005835 | CMake | CMake | public | 2007-10-08 15:26 | 2011-05-02 14:46 |
Reporter | Brandon Van Every | ||||
Assigned To | David Cole | ||||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | CMake 2.8.4 | |||
Summary | 0005835: define TRUE and FALSE constants | ||||
Description | TRUE and FALSE are not constants, as the following code illustrates: SET(FALSE "whatever") IF(FALSE) MESSAGE("FALSE is a variable") ELSE(FALSE) MESSAGE("You'll never see this") ENDIF(FALSE) IF(TRUE) MESSAGE("You'll never see this") ELSE(TRUE) MESSAGE("TRUE is an uninitialized variable") ENDIF(TRUE) C:\devel\src\cbugs\trueorfalse>cmake -P trueorfalse.cmake FALSE is a variable TRUE is an uninitialized variable The documentation says, "IF(variable) - True if the variable's value is not empty, 0, N, NO, OFF, FALSE, NOTFOUND, or <variable>-NOTFOUND." They also mention TRUE in conjunction with some Find* functions. This can mislead the programmer into believing that TRUE and FALSE are available as constants, and that the statement IF(TRUE) does what you'd expect. Defining TRUE and FALSE to be constants would be safer. Compatibility issues probably wouldn't happen in practice, because people probably aren't using TRUE or FALSE as variables. | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2007-10-08 15:26 | Brandon Van Every | New Issue | |||
2007-10-12 09:40 | Bill Hoffman | Status | new => assigned | ||
2007-10-12 09:40 | Bill Hoffman | Assigned To | => Ken Martin | ||
2008-01-31 04:14 | Brandon Van Every | Note Added: 0010352 | |||
2010-12-14 11:30 | David Cole | Assigned To | Ken Martin => David Cole | ||
2011-01-28 11:13 | David Cole | Note Added: 0025127 | |||
2011-01-28 11:13 | David Cole | Status | assigned => resolved | ||
2011-01-28 11:13 | David Cole | Fixed in Version | => CMake 2.8.4 | ||
2011-01-28 11:13 | David Cole | Resolution | open => no change required | ||
2011-05-02 14:46 | David Cole | Note Added: 0026380 | |||
2011-05-02 14:46 | David Cole | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|