On 07/28/2012 08:32 AM, Paul Eggert wrote: > * lib/stat-time.c: New file. > * lib/stat-time.h: Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END. > (_GL_STAT_TIME_INLINE): New macro. Use it instead of 'static inline'. > * modules/stat-time (Files): Add lib/stat-time.c. > (Depends-on): Add extern-inline. > (lib_SOURCES): Add stat-time.c. > --- > ChangeLog | 8 ++++++++ > lib/stat-time.c | 3 +++ > lib/stat-time.h | 24 ++++++++++++++++-------- > modules/stat-time | 3 +++ > 4 files changed, 30 insertions(+), 8 deletions(-) > create mode 100644 lib/stat-time.c
Unfortunately, gcc 4.4.6 (the version on RHEL 6.3 and CentOS 6, and therefore a very much in-use platform today) doesn't recognize #pragma GCC diagnostic push, which renders the workarounds in _GL_INLINE_HEADER_BEGIN. Would anyone object to a patch along these lines (repeated for each problematic function), which I verified is enough to silence the warnings produced by older gcc? It would mean every client of our static inline macros would have to declare independently from the implementation, if they are worried about warning-free compilation on older gcc versions. If this is not appropriate for gnulib, I think I can work around it in libvirt using the manywarnings module, although I'm having a tough time figuring out how to conditionally disable a particular warning (I want the -Wmissing-prototypes warning with newer gcc, just not when targetting an older gcc that can't push and pop warning levels). diff --git i/lib/stat-time.h w/lib/stat-time.h index 74dd00a..f334d60 100644 --- i/lib/stat-time.h +++ w/lib/stat-time.h @@ -52,6 +52,9 @@ _GL_INLINE_HEADER_BEGIN /* Return the nanosecond component of *ST's access time. */ +/* Silence http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113. */ _GL_STAT_TIME_INLINE long int +get_stat_atime_ns (struct stat const *st); +_GL_STAT_TIME_INLINE long int get_stat_atime_ns (struct stat const *st) { # if defined STAT_TIMESPEC -- Eric Blake [email protected] +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
