Follow-up Comment #3, bug #61433 (project groff):
[comment #2 comment #2:] > [comment #0 original submission:] > > except "mstm.cpp" which only includes "env.h". > > Bjarni presumably means mtsm.cpp <http://git.savannah.gnu.org/cgit/groff.git/tree/src/roff/troff/mtsm.cpp>, which does indeed #include env.h but not div.h. This file doesn't call do_divert(), though, so doesn't need its prototype. > > env.h itself, though, later in the file, does refer again to do_divert(): it's made a friend of "class environment". Thanks, Dave. I would then assume that env.h should itself #include "div.h", but I'm thinking like a simple C programmer here. I don't feel I have mastery of C++ name resolution rules, which are much more complex than those of C. > This is seemingly what prompted Werner to add its prototype (and numerous others) in commit a59ef1e0 <http://git.savannah.gnu.org/cgit/groff.git/commit/?id=a59ef1e0> to pacify "modern" (as of 2005) C++ compilers. Yes, that's how I interpret the commit message too. Thanks for locating this. > If now-modern compilers don't need this, perhaps the other prototypes that commit added could also go away. The commit message does hedge by calling these additions "not really necessary." It looks like far too much work to experimentally revert the changes in that commit one by one. I'm content with pacifying today's compilers, and with doing what makes sense to my simple C brain unless someone with greater expertise can explain to me how that's counterproductive in this situation. _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?61433> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
