PBMS build failure in GCC 4.5

Bug #657830 reported by Andrew Hutchings
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Barry Leslie
Fix Released
Barry Leslie
Fix Committed
Barry Leslie

Bug Description

With Fedora 14 due out early Nov I have been doing Drizzle testing on it. Looks like the clobber workaround isn't working in GCC 4.5:

cc1plus: warnings being treated as errors
plugin/pbms/src/engine_ms.cc: In static member function 'static int32_t MSEngine::dropDatabase(const char*, PBMSResultRec*)':
plugin/pbms/src/engine_ms.cc:338:7: error: variable 'err' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
make[2]: *** [plugin/pbms/src/plugin_libpbms_plugin_la-engine_ms.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/home/linuxjedi/Programming/Bzr/drizzle/gcc45-fixes'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/linuxjedi/Programming/Bzr/drizzle/gcc45-fixes'
make: *** [all] Error 2

gcc --version
gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4)

Related branches

Changed in drizzle:
assignee: nobody → Paul McCullagh (paul-mccullagh)
Changed in drizzle:
assignee: Paul McCullagh (paul-mccullagh) → Barry Leslie (barry-leslie)
Revision history for this message
Barry Leslie (barry-leslie) wrote :

This is a bit of a bugger because I think this is actually a compiler/optimizer bug.

I can rearrange the code so that 'err' is not even in scope when setjmp() is called and it still reports it as possibly being clobbered.

I do not like the CLOBBER_PROTECT() macro though because it works by making assumptions about what the compiler does.

I will see if I cannot change this so that CLOBBER_PROTECT() is no longer needed.

Changed in drizzle:
status: New → Confirmed
Revision history for this message
Barry Leslie (barry-leslie) wrote :

I have updated the PBMS code in the branch:

Please use this branch to test if this now builds with GCC 4.5 on Fedora 14.

Changed in drizzle:
status: Confirmed → Fix Committed
Changed in pbms:
assignee: nobody → Barry Leslie (barry-leslie)
status: New → Fix Committed
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

it compiles! Nice one :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.