__alignof__(void)

Jeffrey A Law law@cygnus.com
Wed Sep 9 20:50:00 GMT 1998


  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



More information about the Gcc mailing list