Believe found bug, would like to be sure w/experts POV

James E Wilson wilson@specifixinc.com
Tue Sep 14 00:32:00 GMT 2004


George Garvey wrote:
>>George Garvey wrote:
>>>   I believe the following code represents a g++ bug. It is selecting
>>>a method based on char * being the same as va_list.
> Would someone please tell me the reason that 9942 was closed by Mark
> Mitchell as not a defect? It looks like the same thing I've hit here.

va_list isn't an actual type.  It is a macro that expands to some other 
type.  For x86, that is char *.  So when calling a C++ overloaded 
function, there is no way to distinguish between a va_list argument and 
a char * argument, as they are exactly the same thing.

The code you wrote isn't portable.  Whether it works depends on the type 
used for va_list by the target.  If the target uses a unique type for 
va_list, it will work.  Otherwise, it won't.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc-bugs mailing list