Is this a bad pointer bug?
Marcel Cox
marcel_cox@hotmail.com
Fri Jul 18 11:42:00 GMT 2003
"H. J. Lu" <hjl@lucon.org> wrote in message
news:20030718041719.GA21789@lucon.org...
> # cat x.c
> #include <stdlib.h>
>
> struct a
> {
> unsigned int x[11];
> };
>
> unsigned long i;
> struct a *c=( struct a*)0x3f736080UL, *b= (struct a*)0x1000048UL;
>
> int
> main()
> {
> i = (0x3f736080UL-0x1000048UL)/sizeof (struct a);
> if (i != (c - b))
> abort ();
> return 0;
> }
> # gcc x.c
> # ./a.out
> zsh: 21264 abort ./a.out
>
> Intel compiler works fine. Is this a really bad pointer bug?
>
Your pointers c and b are not even a multiple of 44 apart. So their
difference is absolutely meaningless.
Marcel
More information about the Gcc
mailing list