This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
GCC and C89 Defect Report 106
- To: gcc-bugs at gcc dot gnu dot org
- Subject: GCC and C89 Defect Report 106
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Sat, 1 Jul 2000 14:43:49 -0700
I've been running C89 conformance suites against my preprocessor
changes. In the process I found a bug in our handling of void
expressions. This code is taken more or less verbatim from Defect
Report #106 against C89
[http://anubis.dkuug.dk/JTC1/SC22/WG14/www/docs/dr_106.html].
void
dr106_1(void *pv, int i)
{
*pv;
i ? *pv : *pv;
*pv, *pv;
}
void
dr106_2(const void *pcv, volatile void *pvv, int i)
{
*pcv;
i ? *pcv : *pcv;
*pcv, *pcv;
*pvv;
i ? *pvv : *pvv;
*pvv, *pvv;
}
Current CVS rejects both these functions with a stack of
"dereferencing pointer to incomplete type" errors, in both normal and
pedantic mode. The Defect Report says that both functions are
well-formed; I believe the logic is that void pointers may be
dereferenced in void context (and the operation is ignored, even if
the pointer is volatile).
This is not an important issue, except in so far as it means we are
not 100% C89 conformant.
zw