This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/22086] void * dereferenced in sizeof() yields 1
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jun 2005 23:50:50 -0000
- Subject: [Bug c/22086] void * dereferenced in sizeof() yields 1
- References: <20050615234558.22086.jboone@logitel.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-15 23:50 -------
This is a GCC extension. sizeof(void) is invalid C and should error out and does with -pedantic-errors
The reason why it is 1 and not 0 is because it is also a GNU extension that you can increment a void
pointer like a char pointer.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Component|preprocessor |c
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22086