Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 6 years ago

Language

C++

Compiler

clang HEAD 8.0.0 (https://github.com/llvm-mirror/clang.git 2bce94da8a363b4ffbd7ba2d6a1941942f9bac04) (https://github.com/llvm-mirror/llvm.git 4fac31c8505da57bf7703e26ee061ea8aba0b139)

Options
Warnings
Boost 1.68.0
C++2a(GNU)
no pedantic
Raw compiler options
-Weverything -Wno-reserved-id-macro

Author

anonymous

over 6 years ago

$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.68.0/clang-head/include -std=gnu++2a -Weverything -Wno-reserved-id-macro
prog.cc:7:62: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    cout << (0.68 + 0.04) << " == " << 0.72 << ": " << (0.72 == (0.68 + 0.04)) << endl;
                                                        ~~~~ ^  ~~~~~~~~~~~~~
prog.cc:8:62: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    cout << (0.69 + 0.04) << " == " << 0.73 << ": " << (0.73 == (0.69 + 0.04)) << endl;
                                                        ~~~~ ^  ~~~~~~~~~~~~~
2 warnings generated.
0.72 == 0.72: 0
0.73 == 0.73: 1
Exit Code:
0