bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #61433] [PATCH] src/roff/troff/div.h: has extra declaration of "do_


From: G. Branden Robinson
Subject: [bug #61433] [PATCH] src/roff/troff/div.h: has extra declaration of "do_divert(...)"
Date: Tue, 30 Nov 2021 02:48:31 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]