This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __alignof__(void)
- To: Nathan Sidwell <nathan at acm dot org>
- Subject: Re: __alignof__(void)
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 09 Sep 1998 20:10:22 -0600
- cc: egcs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <35F55F4A.1CF5@acm.org>you write:
> Hi,
> What is a desirable value for __alignof__(void) to return? Documentation
> does not comment. Currently it returns 1, and the gcc's source code
> treats it the same as an ERROR_MARK node.
I don't know.
> IMHO a useful value to return would be the maximum alignment for any
> type. I can't see a use for the current behaviour, but I can (and do)
> have a use for the suggested behaviour. By default, gcc treats
> sizeof(void) as 1, and allows void pointer arithmetic, I don't think
> there's a pressing reason for alignof to do the same.
Interesting idea. I've got no particular objection if the langauge
lawyer types think it's reasonable and there's no upcoming standard
that will define an alignof operator (can someone check c9x? to see
if they've added anything like alignof?)
jeff