Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 30 Apr 2014 23:42:51 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Cc: Pawel Dziepak <pdziepak@...rnos.org>
Subject: Re: [PATCH] add definition of max_align_t to stddef.h

* Pawel Dziepak <pdziepak@...rnos.org> [2014-04-30 22:23:01 +0200]:
>  
> +TYPEDEF union { long double ld; long long ll; } max_align_t;

this is wrong

- ld and ll identifiers are not reserved for the implementation
(you could name them _ld, _ll or __ld, __ll etc)

and see previous max_align_t discussion
http://www.openwall.com/lists/musl/2014/04/28/8

- compiler implementations are non-conforming on some platforms
(_Alignof returns inconsistent results for the same object type so
reasoning about alignments is problematic, there are exceptions
where this is allowed in c++11 but not in c11)

- max_align_t is part of the abi and your solution is incompatible
with gcc and clang (your definition gives 4 byte _Alignof(max_align_t)
on i386 instead of 8)

there is probably not much choice and musl will have to copy the
silly definition used in gcc/clang making max_align_t not very
useful (it does not reflect malloc alignment supported by the libc
nor the object alignments supported by the compiler)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.