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