In <https://lists.gnu.org/r/grep-devel/2020-09/msg00028.html> on 9/17/20 8:30 AM, Nelson H. F. Beebe wrote:

On Hipster OpenIndiana, I get this compilation failure with 
CC=/opt/solarisstudio12.4/bin/cc:

   CC       malloca.o
"malloca.h", line 113: non-constant enumerator value
"malloca.h", line 114: non-constant enumerator value
"malloca.h", line 115: non-constant enumerator value
"malloca.h", line 116: non-constant enumerator value
cc: acomp failed for malloca.c

I am not seeing this problem with Oracle Solaris Studio 12.4 on Solaris 10 
sparc.

What compiler flags are being used on your platform? (Use "make V=1" to see.)

Can you reproduce the problem with the attached file cc-test.c, compiling with plain 'cc -S cc-test.c'?

If so, can you send the file generated by 'cc -E cc-test.c >cc-test.i'? For reference, the output I get with Oracle Solaris Studio 12.4 is attached as cc-test.i. The only difference I see between 12.4 and 12.6 (the current stable release of Solaris Studio) is in the last line, where the attached cc-test.i says this with 12.4:

#ident "acomp: Sun C 5.13 SunOS_sparc 2014/10/20"

whereas with 12.6 it says this:

#ident "acomp: Studio 12.6 Sun C 5.15 SunOS_sparc 2017/05/30"
#include <stddef.h>
/* Determine the alignment of a type at compile time.  */
#if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
# define sa_alignof __alignof__
#elif defined __cplusplus
  template <class type> struct sa_alignof_helper { char __slot1; type __slot2; };
# define sa_alignof(type) offsetof (sa_alignof_helper<type>, __slot2)
#elif defined __hpux
  /* Work around a HP-UX 10.20 cc bug with enums constants defined as offsetof
     values.  */
# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
#elif defined _AIX
  /* Work around an AIX 3.2.5 xlc bug with enums constants defined as offsetof
     values.  */
# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
#else
# define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
#endif

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),
  sa_alignment_longlong = sa_alignof (long long),
  sa_alignment_longdouble = sa_alignof (long double),
  sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1)
                      | (sa_alignment_longlong - 1)
                      | (sa_alignment_longdouble - 1)
                     ) + 1
};
# 1 "cc-test.c"
# 1 "/usr/include/stddef.h"
 
 

 
 
 

 
# 12

# 15

#ident  "@(#)stddef.h   1.18    04/09/28 SMI"

# 1 "/usr/include/sys/isa_defs.h"
 
# 4

# 7

#ident  "@(#)isa_defs.h 1.30    11/03/31 SMI"

 
# 191

# 195

 
# 395

 
# 402

 
# 412

 
# 433

 
# 442

 
# 448

 
# 457

# 459

 
# 467

 
# 499

 
# 506

# 510

# 514

# 1 "/usr/include/iso/stddef_iso.h"
 
 

 
 
 

 
# 12

 
# 24

# 27

#ident  "@(#)stddef_iso.h       1.2     03/03/06 SMI"

# 1 "/usr/include/sys/isa_defs.h"
 
# 4

# 31 "/usr/include/iso/stddef_iso.h"

# 35

# 39

# 47

# 53
typedef int     ptrdiff_t;               
# 56

# 62
typedef unsigned int    size_t;          
# 65

# 69

# 75

# 79

# 20 "/usr/include/stddef.h"

 
# 29

# 33

 
# 42
typedef long    wchar_t;
# 47

# 51

# 2 "cc-test.c"
 
# 19

enum
{
 
# 24
  sa_alignment_long =  ( size_t ) ( & ( ( ( struct { char __slot1 ; long 
__slot2 ; } * ) 0 ) -> __slot2 ) ),
  sa_alignment_double =  ( size_t ) ( & ( ( ( struct { char __slot1 ; double 
__slot2 ; } * ) 0 ) -> __slot2 ) ),
  sa_alignment_longlong =  ( size_t ) ( & ( ( ( struct { char __slot1 ; long 
long __slot2 ; } * ) 0 ) -> __slot2 ) ),
  sa_alignment_longdouble =  ( size_t ) ( & ( ( ( struct { char __slot1 ; long 
double __slot2 ; } * ) 0 ) -> __slot2 ) ),
  sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1)
                      | (sa_alignment_longlong - 1)
                      | (sa_alignment_longdouble - 1)
                     ) + 1
};
#ident "acomp: Sun C 5.13 SunOS_sparc 2014/10/20"

Reply via email to