Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Language

C++

Compiler

clang HEAD 12.0.0 (https://github.com/llvm/llvm-project.git 035396197a5f129c5ec42e9e46a85c32fa1c1b84)

Options
Warnings
Boost 1.73.0
C++2a
no pedantic
Raw compiler options
-Wunreachable-code

$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/clang-head/include -std=c++2a -Wunreachable-code
prog.cc:6:9: warning: variable 'p' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (size < 256) {
        ^~~~~~~~~~
prog.cc:10:9: note: uninitialized use occurs here
    if (p != nullptr) // C4701 and C4703
        ^
prog.cc:6:5: note: remove the 'if' if its condition is always true
    if (size < 256) {
    ^~~~~~~~~~~~~~~~
prog.cc:5:12: note: initialize the variable 'p' to silence this warning
    void* p;
           ^
            = nullptr
1 warning generated.
Exit Code:
0