Claus Assmann | 8 Dec 2011 03:14

m4 1.4.16 compilation error on SunOS 5.10: __attribute__

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
 <at>  <at>  -32,7 +32,7  <at>  <at> 

 extern void verror (int __status, int __errnum, const char *__format,
(Continue reading)

Eric Blake | 12 Dec 2011 18:23
Picon
Favicon
Gravatar

Re: m4 1.4.16 compilation error on SunOS 5.10: __attribute__

On 12/07/2011 07:14 PM, Claus Assmann wrote:
> 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__

Thanks for the report.

> 
> 
> A possible patch follows:
> 
> --- lib/verror.h-	Wed Dec  7 16:41:06 2011
> +++ lib/verror.h	Wed Dec  7 16:41:08 2011
>  <at>  <at>  -32,7 +32,7  <at>  <at> 
>  
>  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)));

Not quite right.  Upstream gnulib already fixed it:
 git.sv.gnu.org/cgit/gnulib.git/commit/?id=f93da2171bca

The next m4 release will be fixed; meanwhile, you can use the gnulib
diff to fix it properly.

--

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
(Continue reading)


Gmane