bug-gnulib
[Top][All Lists]
Advanced

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

Re: stdalign test with HP-UX cc


From: Paul Eggert
Subject: Re: stdalign test with HP-UX cc
Date: Fri, 17 Mar 2017 01:59:16 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

Bruno Haible wrote:

Emacs 25.1 cannot be built with this compiler.

Thanks for looking into this. Ouch. It looks like HP-UX cc has serious bugs in its implementation of C99 flexible array members. I added this issue to emacs/etc/PROBLEMS, and am suggesting GCC instead of HP-UX cc for people who want to build Emacs on HP-UX. See:

http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a09473261c8b11243e68d84c5dc2448d65a67e77


  CCLD     ebrowse
cc: "ebrowse.c", line 281: error 1687: Illegal use of flexible array: structs 
with FAMs cannot be members of other structs.

This suggests that the HP-UX cc flexible array member bug is as follows: if a struct X contains a 'struct Y *' member where 'struct Y' has a flexible array member, the compiler incorrectly rejects the definition of struct X. Does the attached Gnulib patch suffice to detect the HP-UX cc bug? If so, this should fix Emacs's problem with flexible array members on HP-UX cc. I installed this patch into Gnulib since it shouldn't hurt even if it doesn't catch the HP-UX cc bug.


For the problem with __attribute__ ((__aligned__ (8))), does it suffice to put the declaration after the identifier? E.g., does this compile:

int foo __attribute__ ((__aligned__ (8))) = 10;

whereas this does not compile?

int __attribute__ ((__aligned__ (8))) bar = 20;

If so, I think we can work around this problem in Emacs (even if we cannot solve the problem in general for Gnulib stdalign), and something like the patch you proposed should suffice for Gnulib (although we'd also need to fix m4/stdalign.m4 to keep it in sync with lib/stdalign.in.h).

Also, in your build of Emacs 25.1, is the symbol HAVE_STRUCT_ATTRIBUTE_ALIGNED defined in src/config.h?

Attachment: 0001-flexmember-try-to-detect-HP-UX-11.31-cc-bug.patch
Description: Text Data


reply via email to

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