bug-gnu-utils
[Top][All Lists]
Advanced

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

gettext 0.14.1 fails to build on HP-UX with HP C compiler


From: Albert Chin-A-Young
Subject: gettext 0.14.1 fails to build on HP-UX with HP C compiler
Date: Tue, 25 May 2004 23:44:10 -0500
User-agent: Mutt/1.5.6i

While building gettext-0.14.1 on HP-UX 10.20 and 11.x with the HP C
compiler:
  ...
gmake[3]: Entering directory
`/opt/build/gettext-0.14.1/gettext-runtime/lib'
cc -DDEPENDS_ON_LIBINTL=1 -DHAVE_CONFIG_H -I. -I. -I..  -I. -I. -I..
-I../intl -I./../intl -I../../gettext-tools/lib
-I./../../gettext-tools/lib -I/opt/TWWfsw/libiconv19/include  +O2 -Ae
-z +ESlit +Onofltacc +DAportable +Oentrysched +Odataprefetch -c
setenv.c
cc: "../../gettext-tools/lib/allocsa.h", line 96: error 1509:
Enumeration value must be constant.
cc: "../../gettext-tools/lib/allocsa.h", line 106: warning 551:
Integer division by zero.
gmake[3]: *** [setenv.o] Error 1

allocsa.h has:
enum
{
/* The desired alignment of memory allocations is the maximum alignment
   among all elementary types.  */
  sa_alignment_long = sa_alignof (long),
  sa_alignment_double = sa_alignof (double),
#ifdef HAVE_LONG_LONG
  sa_alignment_longlong = sa_alignof (long long),
#endif
#ifdef HAVE_LONG_DOUBLE
  sa_alignment_longdouble = sa_alignof (long double),
#endif
  sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1)
#ifdef HAVE_LONG_LONG 
                      | (sa_alignment_longlong - 1)
#endif
#ifdef HAVE_LONG_DOUBLE
                      | (sa_alignment_longdouble - 1)
#endif
                     ) + 1,
/* The increment that guarantees room for a magic word must be >= sizeof (int)
   and a multiple of sa_alignment_max.  */
  sa_increment = ((sizeof (int) + sa_alignment_max - 1) / sa_alignment_max) * 
sa_alignment_max
};

HP's C compiler doesn't like reusing an enum constant while defining
the enum. The solution seems to be changing sa_alignment_<type> to
sa_alignof (<type>). Ugly though. I don't get this error with the
vendor compiler from Sun, SGI, Tru64, or AIX.

-- 
albert chin (address@hidden)




reply via email to

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