bug-idutils
[Top][All Lists]
Advanced

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

Re: [bug-idutils] A couple of issues building idutils 4.5 on HP-UX 11


From: Bruno Haible
Subject: Re: [bug-idutils] A couple of issues building idutils 4.5 on HP-UX 11
Date: Mon, 21 Jun 2010 01:46:29 +0200
User-agent: KMail/1.9.9

Richard Lloyd wrote:
> an unmodified gnulib-tests/setenv.c from idutils 4.5 reports this
> when compiled with HP's ANSI C compiler on HP-UX 11.11 (PA-RISC platform)
> via the "gmake check" command:
> 
>   CC       setenv.o
> cc: "setenv.c", line 151: error 1647: Illegal integer-pointer combination for 
> second and third operands of conditional expression (?:).
> cc: "setenv.c", line 151: error 1527: Incompatible types in cast: Must cast 
> from scalar to scalar or to void type.

This means that no previous declaration was present for the function 'malloc'
and/or 'realloc'. The reason is that since 2010-06-09, gnulib/lib/setenv.c
has a "#undef malloc" and "#undef realloc", and unlike most other gnulib
overrides, the "#define malloc rpl_malloc" is done _before_ the system's
<stdlib.h> is included, not after it is included.

> As I said earlier, the fix is to cast the return values from malloc() and
> realloc() to (char *), which seem to satisfy the HP compiler.

This "fix" would do the wrong thing on 64-bit platforms.

Your immediate workaround should be to remove the two #undefs from setenv.c.
I'll post a fix to bug-gnulib.

Thanks for the report!

Bruno



reply via email to

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