NetBSD-Bugs archive

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

standards/52571: max_align_t has smaller alignment than double



>Number:         52571
>Category:       standards
>Synopsis:       max_align_t has smaller alignment than double
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 25 16:55:00 +0000 2017
>Originator:     Bruno Haible
>Release:        netbsd-8 201709170600Z
>Organization:
GNU
>Environment:
NetBSD netbsd8 8.0_BETA NetBSD 8.0_BETA (GENERIC.201709170600Z) i386
>Description:
max_align_t is supposed to have the largest alignment among the standard C types. But here, __alignof__(max_align_t) < __alignof__(double).

This breaks compilation of some GNU packages, because gnulib has a compile-time assertion:
verify(__alignof__ (double) <= __alignof__ (max_align_t));

>How-To-Repeat:
Compile this file:
=============================
#include <stddef.h>
int aaa = __alignof__(double);
int aab = __alignof__(max_align_t);
=============================
gcc -S x.c
You can see that aaa has the value 8, whereas aab has the value 4.

>Fix:



Home | Main Index | Thread Index | Old Index