|
|
Subscribe / Log in / New account

NULL v. zero

NULL v. zero

Posted Jul 26, 2004 16:41 UTC (Mon) by h.j.thomassen (guest, #15232)
Parent article: NULL v. zero

vivi48: You are correct. I looked in my copy of the ISO/IEC FDIS 9899
(i.e. the C-99 standard at ISO-level) and it says in para. 6.2.5 [26]:

<quote:> A pointer to void shall have the same representation and alignment
requirements as a pointer to a character type. <footnote:> Meant to
imply interchangeability as arguments to functions, return values
from functions, and members of unions. <end quote>

(ANSI X3.159-1989 has this same text in para. 3.1.2.5 [25])

Also: the va_arg description (para 7.15.1.1) has a discussion about
type-mismatches between caller and callee, and it says that this
will have undefined behaviour, except if <quote:> one type is pointer
to void and the other is a pointer to a character type <end quote>.

Thanks for pointing :-) this out.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds