From a9b2ffe678c6a5ccf3fcae185ace9483d53f1c83 Mon Sep 17 00:00:00 2001 From: Bjarni Ingi Gislason Date: Sat, 6 Nov 2021 02:45:35 +0000 Subject: [PATCH] src/roff/troff/div.h: has extra declaration of "do_divert(...)" Both "div.h" and "env.h" include "do_divert(...)". cpp-files include either both "env.h" and "div.h" or neither, except "mstm.cpp" which only includes "env.h". gcc 11.2.0-10 (Debian testing) reports a repeated declaration of "do_divert(...)" so it should be commented out in "div.h". In file included from ../src/roff/troff/div.cpp:31: ../src/roff/troff/div.h:20:6: warning: redundant redeclaration of 'void do_divert(int, int)' in same scope [-Wredundant-decls] 20 | void do_divert(int append, int boxing); | ^~~~~~~~~ In file included from ../src/roff/troff/div.cpp:27: ../src/roff/troff/env.h:401:15: note: previous declaration of 'void do_divert(int, int)' 401 | friend void do_divert(int append, int boxing); | ^~~~~~~~~ CXX src/roff/troff/env.o In file included from ../src/roff/troff/env.cpp:28: ../src/roff/troff/div.h:20:6: warning: redundant redeclaration of 'void do_divert(int, int)' in same scope [-Wredundant-decls] 20 | void do_divert(int append, int boxing); | ^~~~~~~~~ In file included from ../src/roff/troff/env.cpp:24: ../src/roff/troff/env.h:401:15: note: previous declaration of 'void do_divert(int, int)' 401 | friend void do_divert(int append, int boxing); | ^~~~~~~~~ CXX src/roff/troff/input.o In file included from ../src/roff/troff/input.cpp:30: ../src/roff/troff/div.h:20:6: warning: redundant redeclaration of 'void do_divert(int, int)' in same scope [-Wredundant-decls] 20 | void do_divert(int append, int boxing); | ^~~~~~~~~ In file included from ../src/roff/troff/input.cpp:26: ../src/roff/troff/env.h:401:15: note: previous declaration of 'void do_divert(int, int)' 401 | friend void do_divert(int append, int boxing); | ^~~~~~~~~ CXX src/roff/troff/mtsm.o CXX src/roff/troff/node.o In file included from ../src/roff/troff/node.cpp:35: ../src/roff/troff/div.h:20:6: warning: redundant redeclaration of 'void do_divert(int, int)' in same scope [-Wredundant-decls] 20 | void do_divert(int append, int boxing); | ^~~~~~~~~ In file included from ../src/roff/troff/node.cpp:31: ../src/roff/troff/env.h:401:15: note: previous declaration of 'void do_divert(int, int)' 401 | friend void do_divert(int append, int boxing); | ^~~~~~~~~ ../src/roff/troff/node.cpp: In copy constructor 'tfont_spec::tfont_spec(const tfont_spec&)': ../src/roff/troff/node.cpp:192:48: warning: implicitly-declared 'constexpr tfont_spec& tfont_spec::operator=(const tfont_spec&)' is deprecated [-Wdeprecated-copy] 192 | tfont_spec(const tfont_spec &spec) { *this = spec; } | ^~~~ ../src/roff/troff/node.cpp:192:3: note: because 'tfont_spec' has user-provided 'tfont_spec::tfont_spec(const tfont_spec&)' 192 | tfont_spec(const tfont_spec &spec) { *this = spec; } | ^~~~~~~~~~ CXX src/roff/troff/number.o In file included from ../src/roff/troff/number.cpp:26: ../src/roff/troff/div.h:20:6: warning: redundant redeclaration of 'void do_divert(int, int)' in same scope [-Wredundant-decls] 20 | void do_divert(int append, int boxing); | ^~~~~~~~~ In file included from ../src/roff/troff/number.cpp:24: ../src/roff/troff/env.h:401:15: note: previous declaration of 'void do_divert(int, int)' 401 | friend void do_divert(int append, int boxing); | ^~~~~~~~~ Signed-off-by: Bjarni Ingi Gislason --- src/roff/troff/div.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/roff/troff/div.h b/src/roff/troff/div.h index 5c01f08a..8a02dc55 100644 --- a/src/roff/troff/div.h +++ b/src/roff/troff/div.h @@ -17,7 +17,7 @@ for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -void do_divert(int append, int boxing); +/* void do_divert(int append, int boxing); is declared in env.h */ void end_diversions(); void page_offset(); -- 2.33.0