Bug 29313

Summary: [FIX] pkg-config fails to build C99
Product: pkg-config Reporter: Jeremy Huddleston Sequoia <jeremyhu>
Component: srcAssignee: Tollef Fog Heen <tfheen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: pkg-config-c99.patch

Description Jeremy Huddleston Sequoia 2010-07-29 20:39:16 UTC
Created attachment 37449 [details]
pkg-config-c99.patch

glib-1.2.10 included with pkg-config has incorrect inline handling for C99.  

According to C99 inline semantics, the inline function is only an alternative that the compiler is allowed to use, but it may call an external definition (which, by implication, must exist) if it chooses. "It is unspecified whether a call to the function uses the inline definition or the external definition". The relevant section in the C99 standard is 6.7.4p6.

You can see this failure by using CFLAGS="-std=gnu99".  The clang compiler defaults to gnu99 which means this issue will become more prevalent as it gains adoption.  A fix is attached.
Comment 1 Jeremy Huddleston Sequoia 2010-07-29 23:34:20 UTC
Actually, a better fix would be to:

#ifdef __GNUC_GNU_INLINE__
Comment 2 Tollef Fog Heen 2011-04-13 11:27:07 UTC
We've dropped the embedded glib tarball now, so closing this bug.

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.