Bug 52614 - udisks-1.99.0 fails to build with gcc-4.5 "error: #pragma GCC diagnostic not allowed inside functions"
Summary: udisks-1.99.0 fails to build with gcc-4.5 "error: #pragma GCC diagnostic not ...
Status: RESOLVED FIXED
Alias: None
Product: udisks
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-28 09:02 UTC by Samuli Suominen
Modified: 2012-10-13 10:00 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Samuli Suominen 2012-07-28 09:02:31 UTC
I suppose it's stupid to lose backwards compability for diagnostics and the pragmas should be moved out of the function again.

With GNU GCC 4.5.3:

udisksclient.c: In function 'udisks_client_get_id_for_display':
udisksclient.c:2219:9: error: #pragma GCC diagnostic not allowed inside functions
udisksclient.c:2220:9: error: #pragma GCC diagnostic not allowed inside functions
udisksclient.c:2222:17: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
udisksclient.c:2224:17: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
udisksclient.c:2226:9: error: #pragma GCC diagnostic not allowed inside functions
udisks-generated.c: In function '_udisks_drive_emit_changed':

Reported here:

http://bugs.gentoo.org/428398

I can verify udisks-1.99.0 builds OK with gcc-4.6 and gcc-4.7, but not with gcc-4.5 or older.
Comment 1 David Zeuthen (not reading bugmail) 2012-10-02 18:16:02 UTC
Is there a way to #ifdef our way out of this? Patches welcome - thanks
Comment 2 David Zeuthen (not reading bugmail) 2012-10-13 10:00:13 UTC
Fixed on master


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.