Tim, All,
Building kipi-plugins today I received the following:
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../kipi-plugins/common/include -I/opt/trinity/include -I/opt/trinity/include -I/opt/trinity/include -I/opt/trinity/include -I/opt/tqt3/include -I. -include tqt.h -I/opt/trinity/include/tde -DQT_THREAD_SUPPORT -D_REENTRANT -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -fno-builtin -g3 -fno-inline -march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -I/usr/include/tqt -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -MT rawdecodingiface.lo -MD -MP -MF .deps/rawdecodingiface.Tpo -c rawdecodingiface.cpp -fPIC -DPIC -o .libs/rawdecodingiface.o rawdecodingiface.cpp: In member function 'bool KIPIRawConverterPlugin::RawDecodingIface::loadedFromDcraw(const TQString&, TQString&, KIPIRawConverterPlugin::SaveSettingsWidget::OutputFormat, const TQByteArray&, int, int)': rawdecodingiface.cpp:302:76: error: invalid conversion from 'char*' to 'png_const_bytep {aka const unsigned char*}' [-fpermissive] In file included from rawdecodingiface.h:35:0, from rawdecodingiface.cpp:65: /usr/include/png.h:2276:1: error: initializing argument 5 of 'void png_set_iCCP(png_structp, png_infop, png_const_charp, int, png_const_bytep, png_uint_32)' [-fpermissive] rawdecodingiface.cpp:309:25: warning: deprecated conversion from string constant to 'png_charp {aka char*}' [-Wwrite-strings] rawdecodingiface.cpp:320:100: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] rawdecodingiface.cpp:324:92: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] rawdecodingiface.cpp: In member function 'long int KIPIRawConverterPlugin::RawDecodingIface::formatStringList(char*, size_t, const char*, va_list)': rawdecodingiface.cpp:660:55: warning: function might be possible candidate for 'gnu_printf' format attribute [-Wmissing-format-attribute] rawdecodingiface.cpp: In member function 'bool KIPIRawConverterPlugin::RawDecodingIface::loadedFromDcraw(const TQString&, TQString&, KIPIRawConverterPlugin::SaveSettingsWidget::OutputFormat, const TQByteArray&, int, int)': rawdecodingiface.cpp:481:59: warning: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
I was thinking Darrell already had a patch for this that allowed it to build w/o -fpermissive. This might just be one of the -fpermissive issues that needs fixing. Anybody know if a patch exists for this on gcc 4.7?
I was thinking Darrell already had a patch for this that allowed it to build w/o -fpermissive. This might just be one of the -fpermissive issues that needs fixing. Anybody know if a patch exists for this on gcc 4.7?
There was no libpng patch for kipi-plugins. I'm curious why I never saw the same build failure. My log shows the warnings but not the failure.
If a patch is needed, look at what we did for digikam:
http://git.trinitydesktop.org/cgit/digikam/commit/?id=a94890345ef2caae35a72e...
Darrell
On 05/04/2012 12:52 PM, Darrell Anderson wrote:
I was thinking Darrell already had a patch for this that allowed it to build w/o -fpermissive. This might just be one of the -fpermissive issues that needs fixing. Anybody know if a patch exists for this on gcc 4.7?
There was no libpng patch for kipi-plugins. I'm curious why I never saw the same build failure. My log shows the warnings but not the failure.
If a patch is needed, look at what we did for digikam:
http://git.trinitydesktop.org/cgit/digikam/commit/?id=a94890345ef2caae35a72e...
Darrell
OK,
This is one that does build with -fpermissive, but I was eliminating those from the initial gcc47 build scripts. I'll have a look. I'm certain it will be a simple fix -- the only question will be -- how long it takes me to see it :)
On 05/04/2012 01:04 PM, David C. Rankin wrote:
On 05/04/2012 12:52 PM, Darrell Anderson wrote:
I was thinking Darrell already had a patch for this that allowed it to build w/o -fpermissive. This might just be one of the -fpermissive issues that needs fixing. Anybody know if a patch exists for this on gcc 4.7?
There was no libpng patch for kipi-plugins. I'm curious why I never saw the same build failure. My log shows the warnings but not the failure.
If a patch is needed, look at what we did for digikam:
http://git.trinitydesktop.org/cgit/digikam/commit/?id=a94890345ef2caae35a72e...
Darrell
OK,
This is one that does build with -fpermissive, but I was eliminating those from the initial gcc47 build scripts. I'll have a look. I'm certain it will be a simple fix -- the only question will be -- how long it takes me to see it :)
Holy crap! It worked!
Somebody who knows what they are doing, please sign off on this patch. If OK, then Darrell can go ahead and push. It builds fine with gcc 4.7 and libpng 1.5 -- and -- eliminates the '-fpermissive' build flag.
On Fri, 04 May 2012 14:00:39 -0500 "David C. Rankin" drankinatty@suddenlinkmail.com wrote:
On 05/04/2012 01:04 PM, David C. Rankin wrote:
On 05/04/2012 12:52 PM, Darrell Anderson wrote:
I was thinking Darrell already had a patch for this that allowed it to build w/o -fpermissive. This might just be one of the -fpermissive issues that needs fixing. Anybody know if a patch exists for this on gcc 4.7?
There was no libpng patch for kipi-plugins. I'm curious why I never saw the same build failure. My log shows the warnings but not the failure.
If a patch is needed, look at what we did for digikam:
http://git.trinitydesktop.org/cgit/digikam/commit/?id=a94890345ef2caae35a72e...
Darrell
OK,
This is one that does build with -fpermissive, but I was eliminating those from the initial gcc47 build scripts. I'll have a look. I'm certain it will be a simple fix -- the only question will be -- how long it takes me to see it :)
Holy crap! It worked!
Somebody who knows what they are doing, please sign off on this patch. If OK, then Darrell can go ahead and push. It builds fine with gcc 4.7 and libpng 1.5 -- and -- eliminates the '-fpermissive' build flag.
(iCCP_data)ICCColorProfile.data() is better replaced by static_cast<iCCP_data>(ICCColorProfile.data()) . This also applies to the digikam patch.
On 05/04/2012 02:41 PM, /dev/ammo42 wrote:
(iCCP_data)ICCColorProfile.data() is better replaced by static_cast<iCCP_data>(ICCColorProfile.data()) . This also applies to the digikam patch.
OK,
How about this one:
On 05/04/2012 04:00 PM, David C. Rankin wrote:
On 05/04/2012 02:41 PM, /dev/ammo42 wrote:
(iCCP_data)ICCColorProfile.data() is better replaced by static_cast<iCCP_data>(ICCColorProfile.data()) . This also applies to the digikam patch.
OK,
How about this one:
the i686 build does not like the second patch...
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../kipi-plugins/common/include -I/opt/trinity/include -I/opt/trinity/include -I/opt/trinity/include -I/opt/trinity/include -I/opt/tqt3/include -I. -include tqt.h -I/opt/trinity/include/tde -DQT_THREAD_SUPPORT -D_REENTRANT -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -fno-builtin -g3 -fno-inline -march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -I/usr/include/tqt -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -MT rawdecodingiface.lo -MD -MP -MF .deps/rawdecodingiface.Tpo -c rawdecodingiface.cpp -fPIC -DPIC -o .libs/rawdecodingiface.o rawdecodingiface.cpp: In member function 'bool KIPIRawConverterPlugin::RawDecodingIface::loadedFromDcraw(const TQString&, TQString&, KIPIRawConverterPlugin::SaveSettingsWidget::OutputFormat, const TQByteArray&, int, int)': rawdecodingiface.cpp:309:75: error: invalid static_cast from type 'char*' to type 'KIPIRawConverterPlugin::iCCP_data {aka unsigned char*}' rawdecodingiface.cpp:320:25: warning: deprecated conversion from string constant to 'png_charp {aka char*}' [-Wwrite-strings]
?? Did I not get your suggestion right??
(iCCP_data)ICCColorProfile.data() is better replaced by
static_cast<iCCP_data>(ICCColorProfile.data()).
This also applies to the digikam patch.
Trying to learn: why is that better?
Darrell
On Fri May 4 2012 18:29:35 Darrell Anderson wrote:
(iCCP_data)ICCColorProfile.data() is better replaced by
static_cast<iCCP_data>(ICCColorProfile.data()).
This also applies to the digikam patch.
Trying to learn: why is that better?
Because the compiler can warn you if somebody changes a declaration and the cast turns into something other than a static cast.
It's better to use a static_cast, dynamic_cast, const_cast or reinterpret_cast than the old-fashioned cast which can try too hard when you'd rather have a warning.
--Mike Bird
On 05/04/2012 08:44 PM, Mike Bird wrote:
Because the compiler can warn you if somebody changes a declaration and the cast turns into something other than a static cast.
It's better to use a static_cast, dynamic_cast, const_cast or reinterpret_cast than the old-fashioned cast which can try too hard when you'd rather have a warning.
Right now, the compiler will not accept it though. You get a FTBFS with the 2nd patch, the first patch builds fine. How do we fix the 2nd patch?
On Fri, 04 May 2012 22:49:46 -0500 "David C. Rankin" drankinatty@suddenlinkmail.com wrote:
On 05/04/2012 08:44 PM, Mike Bird wrote:
Because the compiler can warn you if somebody changes a declaration and the cast turns into something other than a static cast.
It's better to use a static_cast, dynamic_cast, const_cast or reinterpret_cast than the old-fashioned cast which can try too hard when you'd rather have a warning.
Right now, the compiler will not accept it though. You get a FTBFS with the 2nd patch, the first patch builds fine. How do we fix the 2nd patch?
Actually reinterpret_cast is necessary here. The following code compiles on my system (but not if I use static_cast instead):
int main (int argc, char** argv) { return *(reinterpret_cast<unsigned char*>(*argv)); }