]> git.pld-linux.org Git - packages/ddd.git/blob - fix-ftbfs-gcc-9.patch
- rel 15; fix build
[packages/ddd.git] / fix-ftbfs-gcc-9.patch
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
4
5 Last-Update: 2019-10-01
6 Description:
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.
12 ---
13  ddd/DispValue.C |  4 ++--
14  ddd/complete.C  |  2 +-
15  ddd/exit.C      |  2 +-
16  ddd/strclass.C  |  1 +
17  ddd/strclass.h  | 10 ++++++----
18  5 files changed, 11 insertions(+), 8 deletions(-)
19
20 diff --git a/ddd/DispValue.C b/ddd/DispValue.C
21 index de25768..2656242 100644
22 --- a/ddd/DispValue.C
23 +++ b/ddd/DispValue.C
24 @@ -1432,8 +1432,8 @@ void DispValue::get_index_surroundings(string& prefix, string& suffix) const
25  
26      for (int i = 1; i < nchildren(); i++)
27      {
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);
32      }
33  }
34  
35 diff --git a/ddd/complete.C b/ddd/complete.C
36 index b161e74..4bde5ff 100644
37 --- a/ddd/complete.C
38 +++ b/ddd/complete.C
39 @@ -354,7 +354,7 @@ static void complete_reply(const string& complete_answer, void *qu_data)
40         string common_pfx = completions[0];
41         int i;
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);
45  
46         if (completions_size > 1 && input == common_pfx)
47         {
48 diff --git a/ddd/exit.C b/ddd/exit.C
49 index f490c23..664f203 100644
50 --- a/ddd/exit.C
51 +++ b/ddd/exit.C
52 @@ -478,7 +478,7 @@ void get_core_pattern(int signal)
53         str_func_ret = "core";
54      }
55      else {
56 -       readline(patternfile, pattern);
57 +       readline(patternfile, pattern, '\n', 1);
58         core_pat = pattern.chars();
59         while(*core_pat)
60         {
61 diff --git a/ddd/strclass.C b/ddd/strclass.C
62 index be0bade..dfbb054 100644
63 --- a/ddd/strclass.C
64 +++ b/ddd/strclass.C
65 @@ -1563,6 +1563,7 @@ std::istream& operator>>(std::istream& s, string& x)
66      return s;
67  }
68  
69 +
70  int readline(std::istream& s, string& x, char terminator, int discard)
71  {
72      assert(!x.consuming());
73 diff --git a/ddd/strclass.h b/ddd/strclass.h
74 index 7ef16fa..035a17e 100644
75 --- a/ddd/strclass.h
76 +++ b/ddd/strclass.h
77 @@ -811,9 +811,11 @@ public:
78                      const regex& sep);
79  
80      friend string common_prefix(const string& x, const string& y, 
81 -                               int startpos = 0);
82 +                               int startpos);
83 +
84      friend string common_suffix(const string& x, const string& y, 
85 -                               int startpos = -1);
86 +                               int startpos);
87 +
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);
93  
94      friend int readline(std::istream& s, string& x, 
95 -                       char terminator = '\n',
96 -                       int discard_terminator = 1);
97 +                       char terminator,
98 +                       int discard_terminator);
99  
100      // Status
101      unsigned int length() const;
This page took 0.035796 seconds and 3 git commands to generate.