1 From: Sophie Brun <sophie@offensive-security.com>
2 Date: Mon, 30 Sep 2019 16:17:19 +0200
3 Subject: Fix ftbfs with GCC-9
5 Last-Update: 2019-10-01
7 "If a friend declaration specifies a default, it must be a friend
8 function definition, and no other declarations of this function are
9 allowed in the translation unit."
10 Remove default values from declaration and change these functions calls
11 in the code to add default values if not overwritten.
13 ddd/DispValue.C | 4 ++--
17 ddd/strclass.h | 10 ++++++----
18 5 files changed, 11 insertions(+), 8 deletions(-)
20 diff --git a/ddd/DispValue.C b/ddd/DispValue.C
21 index de25768..2656242 100644
24 @@ -1432,8 +1432,8 @@ void DispValue::get_index_surroundings(string& prefix, string& suffix) const
26 for (int i = 1; i < nchildren(); i++)
28 - prefix = common_prefix(prefix, child(i)->full_name());
29 - suffix = common_suffix(suffix, child(i)->full_name());
30 + prefix = common_prefix(prefix, child(i)->full_name(), 0);
31 + suffix = common_suffix(suffix, child(i)->full_name(), -1);
35 diff --git a/ddd/complete.C b/ddd/complete.C
36 index b161e74..4bde5ff 100644
39 @@ -354,7 +354,7 @@ static void complete_reply(const string& complete_answer, void *qu_data)
40 string common_pfx = completions[0];
42 for (i = 1; i < completions_size; i++)
43 - common_pfx = common_prefix(common_pfx, completions[i]);
44 + common_pfx = common_prefix(common_pfx, completions[i], 0);
46 if (completions_size > 1 && input == common_pfx)
48 diff --git a/ddd/exit.C b/ddd/exit.C
49 index f490c23..664f203 100644
52 @@ -478,7 +478,7 @@ void get_core_pattern(int signal)
53 str_func_ret = "core";
56 - readline(patternfile, pattern);
57 + readline(patternfile, pattern, '\n', 1);
58 core_pat = pattern.chars();
61 diff --git a/ddd/strclass.C b/ddd/strclass.C
62 index be0bade..dfbb054 100644
65 @@ -1563,6 +1563,7 @@ std::istream& operator>>(std::istream& s, string& x)
70 int readline(std::istream& s, string& x, char terminator, int discard)
72 assert(!x.consuming());
73 diff --git a/ddd/strclass.h b/ddd/strclass.h
74 index 7ef16fa..035a17e 100644
77 @@ -811,9 +811,11 @@ public:
80 friend string common_prefix(const string& x, const string& y,
84 friend string common_suffix(const string& x, const string& y,
88 friend string replicate(char c, int n);
89 friend string replicate(const string& y, int n);
90 friend string join(const string *src, int n, const string& sep);
91 @@ -864,8 +866,8 @@ public:
92 friend std::istream& operator>>(std::istream& s, string& x);
94 friend int readline(std::istream& s, string& x,
95 - char terminator = '\n',
96 - int discard_terminator = 1);
98 + int discard_terminator);
101 unsigned int length() const;