From 05ad6e6d5a1b71f0c3b5b9101109e484e4972ec7 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 29 Mar 2024 14:35:01 +0100 Subject: [PATCH] attribute: Work around compiler bug of Oracle cc 12.6. * m4/gnulib-common.m4 (gl_COMMON_BODY): Expand _GL_ATTRIBUTE_PACKED to empty on SunPRO C. --- ChangeLog | 6 ++++++ m4/gnulib-common.m4 | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index be46eefc67..86b75a14de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-03-29 Bruno Haible + + attribute: Work around compiler bug of Oracle cc 12.6. + * m4/gnulib-common.m4 (gl_COMMON_BODY): Expand _GL_ATTRIBUTE_PACKED to + empty on SunPRO C. + 2024-03-28 Bruno Haible pthread-h: Fix override of pthread_spinlock_t with non-GNU compilers. diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 73e765c6a7..e51149bf9f 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 88.2 +# gnulib-common.m4 serial 88.3 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -500,8 +500,10 @@ AC_DEFUN([gl_COMMON_BODY], [ minimizing the memory required. */ /* Applies to: struct members, struct, union, in C++ also: class. */ +/* Oracle Studio 12.6 miscompiles code with __attribute__ ((__packed__)) despite + __has_attribute OK. */ #ifndef _GL_ATTRIBUTE_PACKED -# if _GL_HAS_ATTRIBUTE (packed) +# if _GL_HAS_ATTRIBUTE (packed) && !defined __SUNPRO_C # define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__)) # else # define _GL_ATTRIBUTE_PACKED -- 2.39.5