Language
C++
Compiler
gcc 9.2.0
Options
Warnings
Don't Use Boost
C++11
-pedantic-errors
$ g++ prog.cc -Wall -Wextra -std=c++11 -pedantic-errors
Exit Code:
0
Author
anonymous
about 5 years ago
C++
gcc 9.2.0
Author
anonymous
about 5 years ago
$ g++ prog.cc -Wall -Wextra -std=c++11 -pedantic-errors
prog.cc:5:17: warning: 'nodiscard' attribute applied to 'CSingleLock::CSingleLock(std::mutex*, bool)' with void return type [-Wattributes]
5 | [[nodiscard]] CSingleLock (std::mutex*, bool) { }
| ^~~~~~~~~~~
prog.cc: In function 'int main()':
prog.cc:10:24: warning: ignoring return value of 'CSingleLock::CSingleLock(std::mutex*, bool)', declared with attribute nodiscard [-Wunused-result]
10 | CSingleLock(&m, true);
| ^
prog.cc:5:17: note: declared here
5 | [[nodiscard]] CSingleLock (std::mutex*, bool) { }
| ^~~~~~~~~~~