Possible bug in g++: 0U == 0 == NULL?
Joerg Pommnitz
pommnitz@darmstadt.gmd.de
Wed Aug 18 03:05:00 GMT 1999
The following small test case fails to compile with
gcc-2.95:
-----------------------------------
void foo (void *p)
{
}
void foo (unsigned short s)
{
}
int
main ()
{
foo (0U);
}
-----------------------------------
The compiler complains that
test.cc: In function `int main()':
test.cc:12: call of overloaded `foo (unsigned int)' is ambiguous
test.cc:2: candidates are: void foo(void *)
test.cc:6: void foo(short unsigned int)
Note that the argument is 0U and those marked not
to be a pointer...
g++ is
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95/specs
gcc version 2.95 19990728 (release)
--
Regards
Joerg
GMD-IPSI, Dolivostr. 15, Zimmer 120, D-64293 Darmstadt
+49-6151-869-786 (Phone), -818 (FAX)
More information about the Gcc
mailing list