[PATCH] Do not use __attribute__ at non gcc compilers

View: New views
2 Messages — Rating Filter:   Alert me  

[PATCH] Do not use __attribute__ at non gcc compilers

by Bugzilla from alon.barlev@gmail.com :: Rate this Message:

| View Threaded | Show Only this Message

This was already solved (better) in gnulib master.
---
 lib/verror.h |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/verror.h b/lib/verror.h
index 8cb511c..1d50db3 100644
--- a/lib/verror.h
+++ b/lib/verror.h
@@ -32,7 +32,10 @@ extern "C" {
 
 extern void verror (int __status, int __errnum, const char *__format,
                     va_list __args)
-     __attribute__ ((__format__ (__printf__, 3, 0)));
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+     __attribute__ ((__format__ (__printf__, 3, 0)))
+#endif
+  ;
 
 /* Print a message with `vfprintf (stderr, FORMAT, ARGS)';
    if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
@@ -44,7 +47,10 @@ extern void verror (int __status, int __errnum, const char *__format,
 extern void verror_at_line (int __status, int __errnum, const char *__fname,
                             unsigned int __lineno, const char *__format,
                             va_list __args)
-     __attribute__ ((__format__ (__printf__, 5, 0)));
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+     __attribute__ ((__format__ (__printf__, 5, 0)))
+#endif
+  ;
 
 #ifdef __cplusplus
 }
--
1.7.3.4


_______________________________________________
M4-patches mailing list
M4-patches@...
https://lists.gnu.org/mailman/listinfo/m4-patches

Re: [PATCH] Do not use __attribute__ at non gcc compilers

by eblake :: Rate this Message:

| View Threaded | Show Only this Message

On 01/03/2012 06:27 AM, Alon Bar-Lev wrote:
> This was already solved (better) in gnulib master.
> ---
>  lib/verror.h |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)

Thanks for the patch; but while it is useful for self-compilation of
existing tarballs, we don't need to do anything in m4.git proper, where
this is automatically fixed by virtue of using updated gnulib master.

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



_______________________________________________
M4-patches mailing list
M4-patches@...
https://lists.gnu.org/mailman/listinfo/m4-patches

signature.asc (633 bytes) Download Attachment