later
later copied to clipboard
Use static declaration for undeclared variable
This was flagged by -Wmissing-variable-declarations
. We could also (1) declare it in the header (2) but it in an anonymous namespace.
Thanks -- after reading some more about static
, I think that pretty much all the top-level variables in these files should be static
, since we don't want them to be accessible from any other files. (I think they can be accessed from other .cpp files if they contain, for example extern int pipe_in
.)
One thing I don't understand, though: in later_posix.cpp
, there are other non-static variables, like hot
and initialized
. Why don't those variables raise the same warning?
I had the same question myself! it might have to do with how they're referenced later...
sadly I'm not an expert here -- I only know what was flagged by our build tools
Can you do the following:
- Make the rest of the top-level variables in those files
static
- Add a
NEWS
item
OK I added more static
qualifiers and a NEWS item, LMK if there's anything else