Bug #44840 ndbapi compiler warning - type qualifier ignored for function return type
Submitted: 13 May 2009 9:35 Modified: 15 Mar 2010 7:33
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: NDB API Severity:S3 (Non-critical)
Version:mysql-5.1-telco-7.0 OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any

[13 May 2009 9:35] Magnus Blåudd
Description:
Several functions in the ndbapi have "const" defined for functions that does not return an lvalue and thus gcc >= 4.3 throws a warning.

Example from NdbEventOperation.hpp 
 const bool tableRangeListChanged() const;
 ^^^^^

How to repeat:
Compile and check warnings.

Suggested fix:
Remove the unnecessary const's. I checked with nm and the functions mangled name does not change, thus it should be safe from a backward compatibility point of view.

 nm .libs/libndbapi.a | grep tableRangeLis 
0000000000000264 T _ZNK17NdbEventOperation21tableRangeListChangedEv

After removing "const"  and recompile
$ nm .libs/libndbapi.a | grep tableRangeLis 
0000000000000264 T _ZNK17NdbEventOperation21tableRangeListChangedEv
[13 May 2009 10:07] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/73915
[13 May 2009 10:15] Bugs System
Pushed into 5.1.34-ndb-7.0.6 (revid:magnus.blaudd@sun.com-20090513101326-rdm2svqcqcxy3b6a) (version source revid:magnus.blaudd@sun.com-20090513101326-rdm2svqcqcxy3b6a) (merge vers: 5.1.34-ndb-7.0.6) (pib:6)
[14 May 2009 14:08] Jon Stephens
Documented bugfix in the NDB-7.0.6 changelog as follows:

      Several NDB API methods were declared using const in the return 
      type, but did not actually return an lvalue, which caused compiler 
      warnings when using gcc 4.3 or newer to perform the build. The 
      methods affected were NdbEventOperation::tableNameChanged(),
      NdbEventOperation::tableFrmChanged(),
      NdbEventOperation::tableFragmentationChanged(),
      NdbEventOperation::tableRangeListChanged(), and
      NdbOperation::getType().

Also updated the signatures of these methods in the Cluster API Guide.
[15 May 2009 9:13] Magnus Blåudd
Will revert since it changes ABI
[15 May 2009 9:18] Bugs System
Pushed into 5.1.34-ndb-7.0.6 (revid:magnus.blaudd@sun.com-20090515091356-trk24xddvjsxf9cd) (version source revid:magnus.blaudd@sun.com-20090515091356-trk24xddvjsxf9cd) (merge vers: 5.1.34-ndb-7.0.6) (pib:6)
[15 May 2009 10:09] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/74180
[15 May 2009 16:03] Jon Stephens
Removed previous changelog entry and associated changes: http://lists.mysql.com/commits/74238

Set status back to Verified for any further handling that might be required.
[7 Oct 2009 12:37] Magnus Blåudd
Since fixing this problem  breajk ABI compatibility, we will not fix it.
[5 Jan 2010 10:12] Magnus Blåudd
We have decided to fix this despite the small ABI break on non gcc compilers. Usage of the affected functions should be very rare.
[5 Jan 2010 11:40] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/95952
[6 Jan 2010 15:54] Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20100106154839-irfws0q3tz7ur6a2) (version source revid:jonas@mysql.com-20100106154839-irfws0q3tz7ur6a2) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[4 Feb 2010 10:20] Bugs System
Pushed into 5.1.44 (revid:joro@sun.com-20100204101444-2j32mhqroo0iiio6) (version source revid:davi.arnaut@sun.com-20100121002118-2pi8ix0z21nshcoa) (merge vers: 5.1.43) (pib:16)
[5 Feb 2010 11:50] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100204063540-9czpdmpixi3iw2yb) (version source revid:alik@sun.com-20100127221310-2pnrwf5hmkhweqrm) (pib:16)
[5 Feb 2010 11:56] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100205113942-oqovjy0eoqbarn7i) (version source revid:alik@sun.com-20100204064210-ljwanqvrjs83s1gq) (merge vers: 6.0.14-alpha) (pib:16)
[5 Feb 2010 12:01] Bugs System
Pushed into 5.5.2-m2 (revid:alik@sun.com-20100203172258-1n5dsotny40yufxw) (version source revid:alexey.kopytov@sun.com-20100123210923-lx4o1ettww9fdkqk) (merge vers: 5.5.2-m2) (pib:16)
[3 Mar 2010 5:41] Jon Stephens
Documented in the NDB-7.1.0 changelog. See my comment from 20090514 for docs info. Closed.
[12 Mar 2010 14:09] Bugs System
Pushed into 5.1.44-ndb-7.0.14 (revid:jonas@mysql.com-20100312135944-t0z8s1da2orvl66x) (version source revid:jonas@mysql.com-20100312115609-woou0te4a6s4ae9y) (merge vers: 5.1.44-ndb-7.0.14) (pib:16)
[12 Mar 2010 14:25] Bugs System
Pushed into 5.1.44-ndb-6.2.19 (revid:jonas@mysql.com-20100312134846-tuqhd9w3tv4xgl3d) (version source revid:jonas@mysql.com-20100312060623-mx6407w2vx76h3by) (merge vers: 5.1.44-ndb-6.2.19) (pib:16)
[12 Mar 2010 14:39] Bugs System
Pushed into 5.1.44-ndb-6.3.33 (revid:jonas@mysql.com-20100312135724-xcw8vw2lu3mijrhn) (version source revid:jonas@mysql.com-20100312103652-snkltsd197l7q2yg) (merge vers: 5.1.44-ndb-6.3.33) (pib:16)