[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/5] stat-time: use extern-inline

From: Eric Blake
Subject: Re: [PATCH 2/5] stat-time: use extern-inline
Date: Tue, 14 Aug 2012 15:14:49 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0

On 07/28/2012 08:32 AM, Paul Eggert wrote:
> * lib/stat-time.c: New file.
> (_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.  */
+get_stat_atime_ns (struct stat const *st);
 get_stat_atime_ns (struct stat const *st)
 # if defined STAT_TIMESPEC

Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]