Dnia 23-03-2006, czw o godzinie 19:05 +0100, mirek boruta napisał(a): > > Problem nie jest czysto debianowy ale może ktoś będzie wiedział co się > > dzieje. > > [EMAIL PROTECTED]:~/mpi$ cat test.cpp > > #include <iostream> > > > > int main() { > > > > int i = -2147483648; > > int j = -1; > > printf("%d\n", i / j); > > return i / j; > > > > } > > [EMAIL PROTECTED]:~/mpi$ g++ -fwrapv test.cpp > > [EMAIL PROTECTED]:~/mpi$ ./a.out > > Floating point exception > > > > Dlaczego ta opcja nie działa? > > z man: > -fwrapv > This option instructs the compiler to assume that signed arithmetic > overflow of addition, subtraction and multiplication wraps around > using twos-complement representation. This flag enables some opti- > mizations and disables others. This option is enabled by default > for the Java front-end, as required by the Java language specifica- > tion.
dla ścisłości znalazłem jeszcze na necie krótkie wyjaśnienie, ponieważ u mnie i bez tej flagi działało (ale to sprawdziłem już po wysłaniu maila) na odejmowaniu (zwykłe --i), więc trochę zgłupiałem co jest z tą flagą grane: http://mailman.iro.umontreal.ca/pipermail/gambit-list/2005-June/000282.html -- mirosław boruta rlu: #344083 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]