In Fedora 26 and gcc (GCC) 7.1.1 20170622 (Red Hat 7.1.1-3), OpenHome compile has been failed.
gcc -o Build/Obj/Posix/Release/OptionParser.o -c -fexceptions -Wall -pipe -D_GNU_SOURCE -D_REENTRANT -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -g -O2 -fvisibility=hidden -Wno-psabi -fPIC -std=c++0x -Werror -IBuild/Include/ OpenHome/TestFramework/OptionParser.cpp
OpenHome/TestFramework/OptionParser.cpp: In member function 'void OpenHome::TestFramework::OptionParser::SetUsage(const TChar)':
OpenHome/TestFramework/OptionParser.cpp:285:30: error: argument 1 null where non-null expected [-Werror=nonnull]
iUsage = new TChar[strlen(iUsage)];
In file included from Build/Include/OpenHome/FunctorMsg.h:6:0,
from Build/Include/OpenHome/Private/TestFramework.h:8,
from OpenHome/TestFramework/OptionParser.cpp:4:
/usr/include/string.h:394:15: note: in a call to function 'size_t strlen(const char)' declared here
extern size_t strlen (const char __s)
^~~~~~
cc1plus: all warnings being treated as errors
make: ** [Common.mak:447: Build/Obj/Posix/Release/OptionParser.o] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.M7wv0P (%build)
Discussion
-
medoc
2017-08-28Hi,
I'll have a look at this. Can you tell me exactly what OpenHome source code you are building (how did you arrive to this error) ?
-
Sanghoon
2017-09-01@medoc
I attached full error log. I tried to build RPM with spec. Please see my attachment.
Attachments
-
medoc
2017-09-01There is a typo in the file ohNet/OpenHome/TestFramework/OptionParser.cpp, line 285
You need to replace:
iUsage = new TChar[strlen(iUsage)];
With
iUsage = new TChar[strlen(aUsage)];I have no time to install fedora 26 or fix the tar file at the moment, but this should enable a manual build.
-
Sanghoon
2017-09-01Thank you. I made rpm file and attached src.rpm file. One patch file was added and some modify .spec file to apply modification your correct code.
Attachments
-
medoc
2017-09-02Thanks ! I'll use your patch until I can make a new release.
-
Anonymous
2017-09-13I got same error and now fixed. Thank you guys :)
-
medoc
2017-09-27Closing this as ohbuild.sh now fixes it (a bit more generic than having an rpm patch because it also does debian).
-
medoc
2017-09-27- status: open --> closed
- milestone: -->