ftrapv question

Mathieu Malaterre mmalater@nycap.rr.com
Sun Sep 26 00:09:00 GMT 2004


Hello,

	Could someone help me understand why gcc is aborting on this code:

#include <stdint.h>

int main()
{
  uint32_t templateID = 0;
  uint32_t p = 0;
  int i = 0;
  uint32_t mask = 0xF0000000;

  templateID |= ((templateID & mask) | (p << (32-4*(i+1))));
}

$ gcc -ftrapv trap.cxx
$ ./a.out

Thanks a bunch,
Mathieu



More information about the Gcc mailing list