DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.63k stars 557 forks source link

use C++ std::string comparison in droption.h to avoid link error #2429

Open mxmssh opened 7 years ago

mxmssh commented 7 years ago

droption.h includes both <string> and <string.h>. We should remove the and replace the strcmp with a std::string comparison.

derekbruening commented 7 years ago

The important piece of information is that you hit a linker error because of this, right? Could you paste that error here. It was in https://github.com/DynamoRIO/drmemory/pull/1982.

mxmssh commented 7 years ago

Yes, it is here

/home/osboxes/drmemory_clean/build/dynamorio/ext/include/droption.h:40:0, from /home/osboxes/drmemory_clean/src/drltrace/drltrace_options.h:33, from /home/osboxes/drmemory_clean/src/drltrace/drltrace_frontend.cpp:44: /usr/include/string.h:369:26: error: previous declaration of ‘const char strcasestr(const char, const char)’ with ‘C++’ linkage extern "C++" const char strcasestr (const char *__haystack, ^ In file included from /home/osboxes/drmemory_clean/src/drltrace/drltrace_frontend.cpp:46:0: /home/osboxes/drmemory_clean/src/common/utils.h:1006:49: error: conflicts with new declaration with ‘C’ linkage