View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0001775 | CMake | public | 2005-04-15 14:40 | 2006-10-04 14:41 | |||||
Reporter | Brad King | ||||||||
Assigned To | Brad King | ||||||||
Priority | high | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | won't fix | ||||||
Platform | OS | OS Version | |||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0001775: CheckFunctionExists and intrinsic functions | ||||||||
Description | The current implementation of CHECK_FUNCTION_EXISTS looks for function foo like this: char foo(); int main() { foo(); return 0; } which works in C because there is no mangling so the function can exist with any signature in the standard library. This fails for "intrinsic" functions on Visual Studio optimizing compilers with the /O2 option. Functions like memcmp are builtin and have a signature known to the compiler. Then the call to it fails even though the function exists. We could instead use this implementation: char memcmp(); int cmakeRequireSymbol(int n, ...) { return n; } int main() { return cmakeRequireSymbol(0, &memcmp); } With this version the real signature of the function does not matter but it still requires the function to exist. By making the return value depend on the code it guarantees that the code requiring the symbol will not be optimized away. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0005178) Brad King (manager) 2006-10-04 14:41 |
CHECK_FUNCTION_EXISTS is now deprecated anyway for reasons like this. CHECK_SYMBOL_EXISTS and other variants handle it. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |