two levels of indirection on a void
Tel
telford@eng.uts.edu.au
Tue Oct 13 19:47:00 GMT 1998
---------------------------------------------------------------------- test.c
void x( void )
{
void **y;
int **z;
y = z;
z = y;
}
----------------------------------------------------------------------
GNU C version egcs-2.91.57 19980901 (egcs-1.1 release) (i586-pc-linux-gnu) compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
test.c: In function `x':
test.c:6: warning: assignment from incompatible pointer type
test.c:7: warning: assignment from incompatible pointer type
but...
---------------------------------------------------------------------- test.c
void x( void )
{
void *y;
int *z;
y = z;
z = y;
}
----------------------------------------------------------------------
compiles without warnings.
In my opinion both should compile without warnings otherwise the language
is inconsistent. If this is a bug then I'm reporting it, if it is the
ANSI standard then someone needs a big kick up the backside (if only I
knew who :-)
- Tel
More information about the Gcc-bugs
mailing list