This is the mail archive of the gcc@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]

Is this a bad pointer bug?


# 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?


H.J.


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