This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52817] g++ do not call a method with same name on some platforms(see small example source attached)
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 01 Apr 2012 12:43:56 +0000
- Subject: [Bug c++/52817] g++ do not call a method with same name on some platforms(see small example source attached)
- Auto-submitted: auto-generated
- References: <bug-52817-4@http.gcc.gnu.org/bugzilla/>
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);