compiler error with gcc-4.6

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
dominique
Posts: 1
Joined: Tue, 2011-06-07, 14:26

compiler error with gcc-4.6

#1 Post by dominique »

Hi,

I am getting following compiler error with gcc-4.6.

/tmp/DCMTK/dcmimgle/include/dcmtk/dcmimgle/discalet.h:189:48: error:
uninitialized const ‘rep’ [-fpermissive]

Here is the code which causes the error:
175
176 /** check whether template type T is signed or not
177 *
178 ** @return true if signed, false otherwise
179 */
180 inline int isSigned() const
181 {
182 const DiPixelRepresentationTemplate<T> rep;
183 return rep.isSigned();
184 }
http://git.dcmtk.org/web?p=dcmtk.git;a= ... ;hb=master


With the following workaround the compiler error disappears. Is this the right thing to do?
- const DiPixelRepresentationTemplate<T> rep;
+ DiPixelRepresentationTemplate<T> rep;

Thanks
Dominique

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#2 Post by J. Riesmeier »

I'm not sure whether this is the correct solution since we have no gcc 4.6 running. However, I'm surprised that "rep" is reported to be an "uninitialized const" since the class DiPixelRepresentationTemplate has a user-provided default constructor.

ymartelli
Posts: 5
Joined: Wed, 2011-06-08, 09:01

#3 Post by ymartelli »

The code works with the default constructor and gcc 4.6. This fix was done after the official release of 3.6.0 so people not having checked out the latest from git will end up with the same error.

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#4 Post by J. Riesmeier »

Do you mean this commit? According to the log, it is part of DCMTK 3.6.0!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest