This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]