This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Possible bug in g++: 0U == 0 == NULL?
- To: gcc at gcc dot gnu dot org
- Subject: Possible bug in g++: 0U == 0 == NULL?
- From: Joerg Pommnitz <pommnitz at darmstadt dot gmd dot de>
- Date: Wed, 18 Aug 1999 12:07:27 +0200
- Organization: GMD
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)