summaryrefslogtreecommitdiff
path: root/Modules/CheckVariableExists.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2004-04-26 10:19:44 -0400
committerBrad King <brad.king@kitware.com>2004-04-26 10:19:44 -0400
commita8b2400f7b18f05791c4db2f46d9772410f19a2c (patch)
tree10718882dc1a347af5886e9a7d00db20c2dd9737 /Modules/CheckVariableExists.c
parent71b57bc4541b12bf874028f15e557c053e5b0b72 (diff)
downloadcmake-a8b2400f7b18f05791c4db2f46d9772410f19a2c.tar.gz
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.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/CheckVariableExists.c b/Modules/CheckVariableExists.c
index 419c1b02ec..752f6e486b 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 */