]> git.sesse.net Git - stockfish/commit - src/evaluate.cpp
Warn if a global function has no previous declaration
authorSebastian Buchwald <UniQP@web.de>
Tue, 27 Dec 2022 20:06:10 +0000 (21:06 +0100)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 9 Jan 2023 19:18:39 +0000 (20:18 +0100)
commit31acd6bab70f4661316986c2c93163d39736fd61
tree9368f0b3708410ee6bb042e8f21744d33fba0575
parentfcee83810a5bcf774d3e13cf9e65ccf3b29e3319
Warn if a global function has no previous declaration

If a global function has no previous declaration, either the declaration
is missing in the corresponding header file or the function should be
declared static. Static functions are local to the translation unit,
which allows the compiler to apply some optimizations earlier (when
compiling the translation unit rather than during link-time
optimization).

The commit enables the warning for gcc, clang, and mingw. It also fixes
the reported warnings by declaring the functions static or by adding a
header file (benchmark.h).

closes https://github.com/official-stockfish/Stockfish/pull/4325

No functional change
src/Makefile
src/benchmark.cpp
src/benchmark.h [new file with mode: 0644]
src/evaluate.cpp
src/misc.cpp
src/nnue/evaluate_nnue.cpp
src/uci.cpp
src/ucioption.cpp