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]

[Bug c++/52817] g++ do not call a method with same name on some platforms(see small example source attached)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52817

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-01 12:43:56 UTC ---
(In reply to comment #1)
> (In reply to comment #0)
> > void Wsafile::readdata(int NumFiles, va_list args) {
> >      long * RWop;
> >      printf("readdata 2 called \n");
> >      RWop = va_arg(args,long *);
> >      printf ("%x ( should be 0x12345678) %d (should be 1) \n",(unsigned
> > int)RWop,NumFiles);  // should print 0x12345678
> 
> This line is probably the problem, unsigned int is too small to hold a pointer
> value, so the value is not preserved.  
> 
> Stop using unsafe casts between incompatible types.

Or it could just be the difference between pointer and integer modes for m68k,
does it help if you change it to this?

printf ("%p ( should be 0x12345678) %d (should be 1) \n", RWop,NumFiles);


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