[solved] dsrdoc.cc fails on opensuse 11.1 buildserver

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Vrenn
Posts: 11
Joined: Fri, 2008-12-19, 11:29

[solved] dsrdoc.cc fails on opensuse 11.1 buildserver

#1 Post by Vrenn »

Hello

I've tried to build several rpm's for the dcmtk on build.opensuse.org.
It works fine exept on the openSUSE 11.1
make[2]: Entering directory `/usr/src/packages/BUILD/dcmtk-3.5.4/dcmsr/libsrc'
c++ -DHAVE_CONFIG_H -DNDEBUG -c -I. -I. -I../include -I../../config/include -I../../ofstd/include -I../../dcmdata/include \
-O -I/usr/include/libxml2 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L -march=i586 -mtune=i686 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables dsrdoc.cc
dsrdoc.cc: In member function 'OFCondition DSRDocument::readXMLDocumentHeader(DSRXMLDocument&, DSRXMLCursor, size_t)':
dsrdoc.cc:570: warning: comparison with string literal results in unspecified behaviour
...
+ umask 022
+ cd /usr/src/packages/BUILD
+ cd dcmtk-3.5.4
+ rm -rf /var/tmp/dcmtk-3.5.4-build
+ exit 0
... checking for files with abuild user/group
... running 00-check-install-rpms
... installing all built rpms
Preparing packages for installation...
dcmtk-3.5.4-11.1
... running 01-check-debuginfo
... testing for empty debuginfo packages
... running 02-check-gcc-output
... testing for serious compiler warnings
(using /usr/lib/build/checks-data/check_gcc_output)
(using //.build.log)

I: Expression compares a char* pointer with a string literal.
Usually a strcmp() was intended by the programmer
E: dcmtk stringcompare dsrdoc.cc:570
System halted.
I believe it doesn't like

Code: Select all

if ((encString == "?") || doc.setEncodingHandler(encString).bad())
Any Ideas?
What will do a

Code: Select all

const char *compareTempChar = "?";
if ((strcmp(encString, *compareTempChar ) == 0) || doc.setEncodingHandler(encString).bad())
?
Is this even an error or what can I tell the people at opensuse?
Last edited by Vrenn on Fri, 2008-12-19, 21:58, edited 1 time in total.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

This seems to be a little bug that is not reported on any other platform we've tested. "encString" is indeed a "const char *", so we need to use "strcmp()" to compare its value.

What about the following:

Code: Select all

const char *encString = characterSetToXMLName(SpecificCharacterSetEnum);
if ((strcmp(encString, "?") == 0) || doc.setEncodingHandler(encString).bad())
Did you encounter any other inaccuracies like this?

Vrenn
Posts: 11
Joined: Fri, 2008-12-19, 11:29

#3 Post by Vrenn »

Actually no (inaccuracies). I'm not an experienced programmer. I just wrote a little qt-dicomviewer for my diploma (and so many thanks to you for my success). As I want to put it on build.opensuse.org to get several rpms (Fedora, Mandriva 08, soon 09, Suse 10.3 up...) I also used the buildservice to get dcmtk.
I hope this is agreeable for you.
This build-service is complaining, as it seems to collect and rank gcc-warnings.
I'll change the code according to your suggestion and submit the changed dcmtk-3.5.4.tar.gz package for testing (once my Vista finally is done with the ntfs-formatting and I can boot Linux).

If it works, can I let the changed sources on the public build-service?

At: "that is not reported on any other platform we've tested..." Building dcmtk from Suse 10.3 up, Suse 11.1 was the first complaining about, what was released yesterday...

Vrenn
Posts: 11
Joined: Fri, 2008-12-19, 11:29

#4 Post by Vrenn »

Yes, it works. now the package goes through this test, although it fails on another one:
dcmtk-3.5.4-18.1.i586.rpm: directories not owned by a package:
- /usr/share/data

Seems that i complains that dcmtk installs into a directory not owned by itself or another one... I'll see what I can do there.

Vrenn
Posts: 11
Joined: Fri, 2008-12-19, 11:29

#5 Post by Vrenn »

Now it works, the source goes fine through the opensuse-buildservice, thank you.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#6 Post by Jörg Riesmeier »

Thank you for the feedback. The patch is also part of the latest DCMTK snapshot.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest