Make it clear which functions that are intended to be translation unit local.
Do not share functions that are meant to be translation unit local with other translation units. Use internal linkage for those consistently.
Make it clear which functions that are intended to be translation unit local.
Do not share functions that are meant to be translation unit local with other translation units. Use internal linkage for those consistently.
Do not share functions that are meant to be translation unit local with
other translation units. Use internal linkage for those consistently.
utACK c3f34d06befa352acb343ad08337123d9474535f
All this does is add static
declarations to functions; if it compiles, it should be correct.
Concept ACK - indeed, not exposing unnecessary symbols is good, it can speed up linking, and also allows the compiler to be smarter with inlining.
Can we somehow verify that you got them all? In C, we’d use -Wmissing-prototypes
but compilers don’t tend to support that for C++.
This is how I created this PR:
I wrote a really dumb three-line bash
script which generated a candidate list of 460 functions that lacked static
despite appearing to be translation unit local.
I manually checked those 460 functions and removed the false positives. The remaining 226 functions were changed.
@practicalswift good enough for me. Just asking because I wouldn’t want PRs like this to be opened every day, there’s already so many maintenance PRs.
utACK c3f34d06befa352acb343ad08337123d9474535f