diff options
author | Brad King <brad.king@kitware.com> | 2004-04-26 14:19:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2004-04-26 14:19:44 (GMT) |
commit | a8b2400f7b18f05791c4db2f46d9772410f19a2c (patch) | |
tree | 10718882dc1a347af5886e9a7d00db20c2dd9737 /Modules/CheckVariableExists.c | |
parent | 71b57bc4541b12bf874028f15e557c053e5b0b72 (diff) | |
download | CMake-a8b2400f7b18f05791c4db2f46d9772410f19a2c.zip CMake-a8b2400f7b18f05791c4db2f46d9772410f19a2c.tar.gz CMake-a8b2400f7b18f05791c4db2f46d9772410f19a2c.tar.bz2 |
BUG#502: Do not let optimizing compilers think the symbol exists. Require the symbol by making the return value depend on it to force linking.
Diffstat (limited to 'Modules/CheckVariableExists.c')
-rw-r--r-- | Modules/CheckVariableExists.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/CheckVariableExists.c b/Modules/CheckVariableExists.c index 419c1b0..752f6e4 100644 --- a/Modules/CheckVariableExists.c +++ b/Modules/CheckVariableExists.c @@ -9,10 +9,8 @@ int main(){ #else int main(int ac, char*av[]){ #endif - int* p; - p = &CHECK_VARIABLE_EXISTS; if(ac > 1000){return *av[0];} - return 0; + return CHECK_VARIABLE_EXISTS; } #else /* CHECK_VARIABLE_EXISTS */ |