Open omoerbeek opened 1 year ago
Is it typical to run lints like this against third-party code?
I can't imagine that any significant fraction of C++ libraries in the wild are clean against -Wmissing-declarations. That lint seems like just a stylistic preference.
The functions are not declared static
, so they can be called from another compilation unit. That means that the prototype should be available somewhere in that compilation unit. Preferably in a header file so that it becomes more easy to make sure the prototype and implementation agree by also including that header file into the compilation unit that has the function definitions. If the functions are not called from outside they should be marked static
.
They are called from Rust.
I see. In that case they cannot be madestatic
. I can see two options remaining: either introduce a prototype in the same file before the definition of the functions, just to silence the compiler, or leave it as-is and accept the warnings. For us specifically the drawback of that is that we aim for a warning-free compile (with pretty strict -W
settings) and that goal becomes impossible to reach.
Steps tor reproduce: use g++ as compiler and take the tutorial and add
to
build.rs
. This produces the following warnings.