False warning

Elliot Lee sopwith@cuc.ml.org
Wed Apr 1 12:58:00 GMT 1998


The following program falsely gives an "incompatible pointer type" warning
for the foobar(&bleh); line, even though '&bleh' is the same as 'bleh'.

#include <stdio.h>

void foobar(char *blah)
{
}

int main(void)
{
	char bleh[20];
	printf("%p, %p\n", bleh, &bleh);
	foobar(&bleh);
	return 0;
}

Hope this helps,
-- Elliot
Chicken Little was right.




More information about the Gcc-bugs mailing list