Browse Source

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.

Brad King 21 years ago
parent
commit
a8b2400f7b
1 changed files with 1 additions and 3 deletions
  1. 1 3
      Modules/CheckVariableExists.c

+ 1 - 3
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 */