help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Usage of -ftrapv


From: Paulo Matos
Subject: Re: Usage of -ftrapv
Date: 16 Jun 2006 14:07:15 -0700
User-agent: G2/0.2

As an addition to my original post: for example,
#include <iostream>
#include <limits>

int main() {

  unsigned int maxi = std::numeric_limits<unsigned int>::max();

  maxi++;

  std::cerr <<  "Value of maxi after sum: " << maxi << std::endl;

  return 0;

}

after compiled with or with -ftrapv g++ generates binary executables
which are exactly the same:
pmatos@euler ~ $ g++ -o ftrapvw ftrapv.cc
pmatos@euler ~ $ g++ -ftrapv -o ftrapv ftrapv.cc
pmatos@euler ~ $ md5sum ftrapv
fa2b15c2dccf7d721ae883cea1e5190e  ftrapv
pmatos@euler ~ $ md5sum ftrapvw
fa2b15c2dccf7d721ae883cea1e5190e  ftrapvw

What's the problem after all?

Cheers,

Paulo Matos



reply via email to

[Prev in Thread] Current Thread [Next in Thread]