Hi All
The current repo is complaining about strdup and strndup during the cpputest build on a mac with LLVM.
Remove TestHarness_c.cpp and it builds fine.
$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
g++ -DHAVE_CONFIG_H -I. -I.. -include ../include/CppUTest/MemoryLeakDetectorMallocMacros.h -I ../include -include ../include/CppUTest/MemoryLeakDetectorNewMacros.h -Wno-c++14-compat -Wno-c++11-long-long -Wno-long-long -Weverything -Wall -Wextra -Wshadow -Wswitch-default -Wswitch-enum -Wconversion -pedantic -Wsign-conversion -Woverloaded-virtual -Wno-disabled-macro-expansion -Wno-padded -Wno-reserved-id-macro -Wno-keyword-macro -Wno-global-constructors -Wno-exit-time-destructors -Wno-weak-vtables -Wno-old-style-cast -g -O2 -MT src/CppUTest/lib_libCppUTest_a-CommandLineArguments.o -MD -MP -MF src/CppUTest/.deps/lib_libCppUTest_a-CommandLineArguments.Tpo -c -o src/CppUTest/lib_libCppUTest_a-CommandLineArguments.o `test -f 'src/CppUTest/CommandLineArguments.cpp' || echo '../'`src/CppUTest/CommandLineArguments.cpp
In file included from <built-in>:337:
In file included from <command line>:3:
In file included from ./../include/CppUTest/MemoryLeakDetectorNewMacros.h:32:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:610:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/string.h:117:7: error:
expected parameter declarator
char *strdup(const char *__s1);
^
./../include/CppUTest/MemoryLeakDetectorMallocMacros.h:40:51: note: expanded
from macro 'strdup'
#define strdup(str) cpputest_strdup_location(str, __FILE__, __LINE__)
^
<scratch space>:421:1: note: expanded from here
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/De...
^
In file included from <built-in>:337:
In file included from <command line>:3:
In file included from ./../include/CppUTest/MemoryLeakDetectorNewMacros.h:32:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:610:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/string.h:117:7: error:
expected ')'
./../include/CppUTest/MemoryLeakDetectorMallocMacros.h:40:51: note: expanded
from macro 'strdup'
#define strdup(str) cpputest_strdup_location(str, __FILE__, __LINE__)
^
<scratch space>:421:1: note: expanded from here
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/De...
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/string.h:117:7: note:
to match this '('
./../include/CppUTest/MemoryLeakDetectorMallocMacros.h:40:45: note: expanded
from macro 'strdup'
#define strdup(str) cpputest_strdup_location(str, __FILE__, __LINE__)
^
In file included from <built-in>:337:
In file included from <command line>:3:
In file included from ./../include/CppUTest/MemoryLeakDetectorNewMacros.h:32:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:610:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/string.h:117:7: error:
conflicting types for 'cpputest_strdup_location'
char *strdup(const char *__s1);
^
./../include/CppUTest/MemoryLeakDetectorMallocMacros.h:40:21: note: expanded
from macro 'strdup'
#define strdup(str) cpputest_strdup_location(str, __FILE__, __LINE__)
^
./../include/CppUTest/MemoryLeakDetectorMallocMacros.h:25:14: note: previous
declaration is here
extern char* cpputest_strdup_location(const char* str, const char* file...
^
In file included from <built-in>:337:
In file included from <command line>:3:
In file included from ./../include/CppUTest/MemoryLeakDetectorNewMacros.h:32:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:610:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/string.h:132:7: error:
expected parameter declarator
char *strndup(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(...
^
./../include/CppUTest/MemoryLeakDetectorMallocMacros.h:41:59: note: expanded
from macro 'strndup'
#define strndup(str, n) cpputest_strndup_location(str, n, __FILE__, __LINE__)
^
<scratch space>:421:1: note: expanded from here
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/De...
^
In file included from <built-in>:337:
In file included from <command line>:3:
In file included from ./../include/CppUTest/MemoryLeakDetectorNewMacros.h:32:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:610:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/string.h:132:7: error:
expected ')'
./../include/CppUTest/MemoryLeakDetectorMallocMacros.h:41:59: note: expanded
from macro 'strndup'
#define strndup(str, n) cpputest_strndup_location(str, n, __FILE__, __LINE__)
^
<scratch space>:421:1: note: expanded from here
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/De...
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/string.h:132:7: note:
to match this '('
./../include/CppUTest/MemoryLeakDetectorMallocMacros.h:41:50: note: expanded
from macro 'strndup'
#define strndup(str, n) cpputest_strndup_location(str, n, __FILE__, __LINE__)
^
In file included from <built-in>:337:
In file included from <command line>:3:
In file included from ./../include/CppUTest/MemoryLeakDetectorNewMacros.h:32:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:610:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/string.h:132:7: error:
conflicting types for 'cpputest_strndup_location'
char *strndup(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(...
^
./../include/CppUTest/MemoryLeakDetectorMallocMacros.h:41:25: note: expanded
from macro 'strndup'
#define strndup(str, n) cpputest_strndup_location(str, n, __FILE__, __LINE__)
^
./../include/CppUTest/MemoryLeakDetectorMallocMacros.h:26:14: note: previous
declaration is here
extern char* cpputest_strndup_location(const char* str, size_t n, const ...
^
6 errors generated.
make[1]: *** [src/CppUTest/lib_libCppUTest_a-CommandLineArguments.o] Error 1
make: *** [all] Error 2
Hi Felipe
Thanks for the prompt action. Unfortunately this is not on my computer. It is on someone's computer in my training class. I did not realize the problem is only in the example code build. So there is no problem with the cpputest buildLVM 8.0. Sorry I did not understand the problem better.
thanks again, James
James Grenning - Author of TDD for Embedded C - wingman-sw.com/tddec
wingman-sw.com
wingman-sw.com/blog
twitter.com/jwgrenning
facebook.com/wingman.sw

--
You received this message because you are subscribed to the Google Groups "cpputest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cpputest+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
====================================
CppUTest 3.8: ./test-suite.log
====================================
# TOTAL: 2
# PASS: 1
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0
.. contents:: :depth: 2
FAIL: CppUTestExtTests
======================
..................................................
..................................................
..................................................
..................................................
..................................................
..................................................
..................................................
.......!..........................................
.....................!
../tests/CppUTestExt/IEEE754PluginTest.cpp:122: error: Failure in TEST(FE__with_Plugin, should_not_fail_again_when_test_has_already_failed)
CHECK(IEEE754ExceptionsPlugin::checkIeee754OverflowExceptionFlag()) failed
............................
....
Errors (1 failures, 454 tests, 452 ran, 1411 checks, 2 ignored, 0 filtered out, 78 ms)
FAIL CppUTestExtTests (exit status: 1)