None
closed
nobody
None
2017-09-27
2017-08-25
Anonymous
No

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
    medoc
    2017-08-28

    Hi,

    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) ?

     
  • medoc
    medoc
    2017-09-01

    There 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
      Sanghoon
      2017-09-01

      Thank 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.

       
  • medoc
    medoc
    2017-09-27

    Closing this as ohbuild.sh now fixes it (a bit more generic than having an rpm patch because it also does debian).

     
  • medoc
    medoc
    2017-09-27

    • status: open --> closed
    • milestone: -->
     

Cancel   Add attachment