bug-gnulib
[Top][All Lists]
Advanced

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

Re: syntax error in m4/socklen.m4


From: Bruno Haible
Subject: Re: syntax error in m4/socklen.m4
Date: Wed, 9 Apr 2008 23:45:12 +0200
User-agent: KMail/1.5.4

Hello,

Dustin J. Mitchell wrote:
> A user is building Amanda on HPUX, and ran into a compiler error:
> 
> | /* end confdefs.h.  */
> | #include <sys/types.h>
> |             #include <sys/socket.h>
> |
> |             int getpeername (int, void *, long int *);
> | int
> | main ()
> | {
> | long int len;
> |             getpeername (0, 0, &len);
> |   ;
> |   return 0;
> | }
> configure:14885: cc -c   conftest.c >&5
> (Bundled) cc: "conftest.c", line 82: error 1000: Unexpected symbol: "i".
> (Bundled) cc: "conftest.c", line 82: error 1002: Unexpected character: 'u'.
> (Bundled) cc: "conftest.c", line 82: error 1000: Unexpected symbol: "<".
> (Bundled) cc: "conftest.c", line 82: error 1000: Unexpected symbol: "/".
> (Bundled) cc: "conftest.c", line 82: error 1000: Unexpected symbol: ".".
> (Bundled) cc: "conftest.c", line 82: error 1000: Unexpected symbol: ">".
> (Bundled) cc: "conftest.c", line 84: error 1705: Function prototypes
> are an ANSI feature.
> 
> that #include shouldn't be indented like that.

It's not only the indented #include which fails. The compiler message
"error 1705: Function prototypes are an ANSI feature." clearly indicates
that many more errors are to be expected, because the compiler is not even
ANSI C89 compliant (in 2008!).

The fix is not in gnulib. The fix is that the user should use an ANSI C
compiler. I use the following paragraph in the INSTALL file of my packages;
maybe the word has not spread enough:

----------------------------------------------------------------------------
Particular Systems
==================

   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU CC
is not installed, it is recommended to use the following options in order
to use an ANSI C compiler:

     ./configure CC="cc -Ae"
----------------------------------------------------------------------------

> I can provide a git patch if desired.

Thank you for the offer. But at this point, it's better to tell the users
how to avoid the rotted compiler from HP.

Bruno





reply via email to

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