Bug 52614

Summary: udisks-1.99.0 fails to build with gcc-4.5 "error: #pragma GCC diagnostic not allowed inside functions"
Product: udisks Reporter: Samuli Suominen <ssuominen>
Component: generalAssignee: David Zeuthen (not reading bugmail) <zeuthen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: freedesktop-bugs
Version: unspecified   
Hardware: All   
OS: Linux (All)   
See Also: http://bugs.gentoo.org/show_bug.cgi?id=428398
Whiteboard:
i915 platform: i915 features:

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.