bug-m4
[Top][All Lists]
Advanced

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

m4 1.4.16 compilation error on SunOS 5.10: __attribute__


From: Claus Assmann
Subject: m4 1.4.16 compilation error on SunOS 5.10: __attribute__
Date: Wed, 7 Dec 2011 18:14:58 -0800
User-agent: Mutt/1.5.20 (2009-08-27)

I just tried to compile m4-1..4.16 on a SunOS 5.10 machine with Sun's compiler
and got this error:

/opt/SUNWspro/bin/cc -fast -xtarget=generic  -xc99=all  -I.      -g -c verror.c
"verror.h", line 35: syntax error before or at: __attribute__
"verror.h", line 35: warning: old-style declaration or incorrect type for: 
__attribute__
"verror.h", line 35: warning: syntax error:  empty declaration
"verror.h", line 47: syntax error before or at: __attribute__
"verror.h", line 47: warning: old-style declaration or incorrect type for: 
__attribute__
"verror.h", line 47: identifier redefined: __attribute__
        current : function() returning int
        previous: function() returning int : "verror.h", line 35
"verror.h", line 47: warning: syntax error:  empty declaration
"verror.c", line 44: identifier redefined: verror
        current : function(int, int, pointer to const char, pointer to void) 
returning void
        previous: function(int, int, pointer to const char, pointer to void) 
returning void : "verror.h", line 33
"verror.c", line 57: identifier redefined: verror_at_line
        current : function(int, int, pointer to const char, unsigned int, 
pointer to const char, pointer to void) returning void
        previous: function(int, int, pointer to const char, unsigned int, 
pointer to const char, pointer to void) returning void : "verror.h", line 44
cc: acomp failed for verror.c


A possible patch follows:

--- lib/verror.h-       Wed Dec  7 16:41:06 2011
+++ lib/verror.h        Wed Dec  7 16:41:08 2011
@@ -32,7 +32,7 @@
 
 extern void verror (int __status, int __errnum, const char *__format,
                     va_list __args)
-     __attribute__ ((__format__ (__printf__, 3, 0)));
+     _GL_ATTRIBUTE_FORMAT ((__format__ (__printf__, 3, 0)));
 
 /* Print a message with `vfprintf (stderr, FORMAT, ARGS)';
    if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
@@ -44,7 +44,7 @@
 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)));
+     _GL_ATTRIBUTE_FORMAT ((__format__ (__printf__, 5, 0)));
 
 #ifdef __cplusplus
 }




reply via email to

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