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: Bruno Haible
Subject: Re: stdalign test with HP-UX cc
Date: Sun, 19 Mar 2017 13:34:36 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-66-generic; KDE/5.18.0; x86_64; ; )

Hi Paul,

I spoke too soon when I wrote:
> I won't report a bug about this patch, because I don't have
> access to a HP-UX IA64 machine.

I have access to such a machine now.


1) About the version numbers:

$ cc -V
cc: HP C/aC++ B3910B A.06.27.03 [Nov 30 2012]

$ aCC -V
aCC: HP C/aC++ B3910B A.06.27.03 [Nov 30 2012]

$ cat ver.c
__HP_cc
__HP_aCC

$ cc -E ver.c
#line 1 "ver.c"
62703
__HP_aCC

$ aCC -E ver.c
#line 1 "ver.c"
__HP_cc
62703

So, as you can see:
  - The version numeber does not include a leading 0. The person who introduced
    that 0 was probably not aware of the syntax of octal numbers in C.
  - Version numbers in HP-UX hppa cc and in HP-UX ia64 cc are unrelated. The 
ones
    in HP-UX hppa cc have a major number of 11 although it's much older. So,
    it's good to keep the '__ia64' in the condition in stdalign.in.h.


2) About the attribute aligned syntax:

$ cat foo.c
int aa __attribute__ ((__aligned__ (8))) = 10;

int ab __attribute__ ((aligned (8))) = 10;

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

int __attribute__ ((aligned (8))) ad = 10;

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

__attribute__ ((aligned (8))) int af = 10;

$ cc -Ae -c foo.c
$ cc -AC99 -c foo.c

So, the compiler does understand the syntax, as promised in the documentation.


3) The test-stdalign test now compiles, but it fails:

$ ./test-stdalign 
../../gltests/test-stdalign.c:88: assertion '(uintptr_t) &(static_char_alignas) 
% TEST_ALIGNMENT == 0' failed
zsh: abort (core dumped)  ./test-stdalign

In the test we already have a bold

#if defined __SUNPRO_C
  /* Avoid a test failure due to Sun Studio Developer Bug Report #2125432.  */
  fputs ("Skipping test: known Sun C compiler bug\n", stderr);
  return 77;
#else

I suggest to add a similar #elif for HP-UX ia64 cc.


Bruno




reply via email to

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