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]

ftrapv question


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


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