You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for CppUtest!
When we are using a program that includes string.h or , then compile fails with this sequence:
./autogen.sh
./configure --prefix=~/cpputest
make
make install
cd examples
make CPPUTEST_HOME=~/cpputest
compiling HelloTest.cpp
/usr/include/string.h:166:37: error: expected identifier before string constant
extern char *strdup (const char *__s)
^
/usr/include/string.h:166:37: error: expected ‘,’ or ‘...’ before string constant
In file included from <command-line>:0:0:
/home/jbrandeb/cpputest/include/CppUTest/MemoryLeakDetectorMallocMacros.h:62:21: error: conflicting declaration of C function ‘char* cpputest_strdup_location(const char*, int)’
#define strdup(str) cpputest_strdup_location(str, __FILE__, __LINE__)
^
/home/jbrandeb/cpputest/include/CppUTest/MemoryLeakDetectorMallocMacros.h:55:14: note: previous declaration ‘char* cpputest_strdup_location(const char*, const char*, int)’
extern char* cpputest_strdup_location(const char* str, const char* file, int line);
^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/string.h:174:55: error: expected identifier before string constant
extern char *strndup (const char *__string, size_t __n)
^
/usr/include/string.h:174:55: error: expected ‘,’ or ‘...’ before string constant
/home/jbrandeb/cpputest/include/CppUTest/MemoryLeakDetectorMallocMacros.h:63:25: error: conflicting declaration of C function ‘char* cpputest_strndup_location(const char*, size_t, int)’
#define strndup(str, n) cpputest_strndup_location(str, n, __FILE__, __LINE__)
^
/home/jbrandeb/cpputest/include/CppUTest/MemoryLeakDetectorMallocMacros.h:56:14: note: previous declaration ‘char* cpputest_strndup_location(const char*, size_t, const char*, int)’
extern char* cpputest_strndup_location(const char* str, size_t n, const char* file, int line);
^~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [../build/MakefileWorker.mk:504: objs/AllTests/HelloTest.o] Error 1
I'll issue a pull request with the code changed to generate the bug.
The text was updated successfully, but these errors were encountered:
#1149 has the example that fails to build. I've isolated it down to the fact that the cmake generated code doesn't have any of the new strdup code due to missing the HAVE_STRDUP define, which configure ends up with.
Thanks for CppUtest!
When we are using a program that includes string.h or , then compile fails with this sequence:
./autogen.sh
./configure --prefix=~/cpputest
make
make install
I'll issue a pull request with the code changed to generate the bug.
The text was updated successfully, but these errors were encountered: