$ g++ --version
g++ (GCC) 7.1.1 20170622 (Red Hat 7.1.1-3)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ -O2 -fPIC -o test test.cpp && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
$ g++ -m32 -O2 -fPIC -o test test.cpp && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
This is on Fedora test machines, using mock for Fedora 26.
$ g++ --version
g++ (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++ -O2 -fPIC test.cpp -o test && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> -1.1172633071198007275e-14 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 2.0028264676141013257e-15 (expected: 0)
$ g++ -fPIC test.cpp -o test && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
$ g++ -O2 test.cpp -o test && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
$ g++ --version
g++ (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ -O2 -fPIC test.cpp -o test && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> -1.1172633071198007275e-14 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 2.0028264676141013257e-15 (expected: 0)
$ g++ -fPIC test.cpp -o test && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
$ g++ -O2 test.cpp -o test && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
This is on Fedora test machines, so Fedora 25.
$ g++ --version
g++ (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ -O2 -fPIC -o test test.cpp && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> -1.1172633071198007275e-14 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 2.0028264676141013257e-15 (expected: 0)
$ g++ -fPIC -o test /home/fedora/qulogic/test.cpp && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
$ g++ -O2 -o test test.cpp && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
$ g++ --version
g++ (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ -O2 -fPIC test.cpp -o test && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> -1.1172633071198007275e-14 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 2.0028264676141013257e-15 (expected: 0)
$ g++ -fPIC test.cpp -o test && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
$ g++ -O2 test.cpp -o test && ./test
Trial 1:
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
-> -347.36689814814809552 (expected: -347.36689814814809552)
Trial 2:
(296.30129417178909534,384.53203916154427588)
(286.67678520563885058,394.15654812769452064)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)
Trial 3:
(310.73805762101443406,370.09527571231893717)
(320.96409839754903714,374.3059983850096728)
(310.73805762101443406,370.09527571231893717)
-> 0 (expected: 0)