File: patch

package info (click to toggle)
cdecl 2.5-15
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 292 kB
  • sloc: ansic: 3,007; yacc: 1,531; makefile: 77; lex: 75; sh: 32
file content (211 lines) | stat: -rw-r--r-- 6,550 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 cdecl (2.5-14) UNRELEASED; urgency=medium
 .
   * Fix gcc-14 build issues (closes: #1074872)
Author: Fredrik Hallenberg <hallon@debian.org>
Bug-Debian: https://bugs.debian.org/1074872

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2024-11-23

--- cdecl-2.5.orig/Makefile
+++ cdecl-2.5/Makefile
@@ -15,9 +15,9 @@
 #
 # add -DUSE_READLINE	To compile in support for the GNU readline library.
 
-CFLAGS= -s -O2 -DUSE_READLINE
+CFLAGS= -g -O2 -DUSE_READLINE
 CC= gcc
-LIBS= -lreadline -ltermcap
+LIBS= -lreadline
 ALLFILES= makefile cdgram.y cdlex.l cdecl.c cdecl.1 testset testset++
 BINDIR= /usr/bin
 MANDIR= /usr/man/man1
@@ -25,11 +25,13 @@ CATDIR= /usr/man/cat1
 INSTALL= install -c
 INSTALL_DATA= install -c -m 644
 
+LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
+
 cdecl: c++decl
-	ln c++decl cdecl
+	ln -s c++decl cdecl
 
 c++decl: cdgram.c cdlex.c cdecl.c
-	$(CC) $(CFLAGS) -o c++decl cdecl.c $(LIBS)
+	$(CC) $(CFLAGS) -o c++decl cdecl.c $(LIBS) $(LDFLAGS)
 	rm -f cdecl
 
 cdlex.c: cdlex.l
@@ -44,7 +46,7 @@ test:
 
 install: cdecl
 	$(INSTALL) cdecl $(BINDIR)
-	ln $(BINDIR)/cdecl $(BINDIR)/c++decl
+	ln -s cdecl $(BINDIR)/c++decl
 	$(INSTALL_DATA) cdecl.1 $(MANDIR)
 	$(INSTALL_DATA) c++decl.1 $(MANDIR)
 
--- cdecl-2.5.orig/cdecl.1
+++ cdecl-2.5/cdecl.1
@@ -274,7 +274,7 @@ NL means the new-line or semi-colon char
 	<modifier>	::= short | long | unsigned | signed | <ptrmod>
 	<ptrmodlist>	::= <ptrmod> <ptrmodlist> | NOTHING
 	<ptrmod>	::= const | volatile | noalias
-	<storage>	::= auto | extern | register | auto
+	<storage>	::= auto | extern | register | static
 	<optstorage>	::= NOTHING | <storage>
 	<options>	::= NOTHING | <options>
 		| create | nocreate
--- cdecl-2.5.orig/cdecl.c
+++ cdecl-2.5/cdecl.c
@@ -67,6 +67,7 @@ char cdeclsccsid[] = "@(#)cdecl.c	2.5 1/
 # include <stddef.h>
 # include <string.h>
 # include <stdarg.h>
+# include <errno.h>
 #else
 # ifndef NOVARARGS
 #  include <varargs.h>
@@ -89,11 +90,12 @@ void free(), exit(), perror();
 
 #ifdef USE_READLINE
 # include <readline/readline.h>
+# include <readline/history.h>
   /* prototypes for functions related to readline() */
-  char * getline();
-  char ** attempt_completion(char *, int, int);
+  char * get_line();
+  char ** attempt_completion(const char *, int, int);
   char * keyword_completion(char *, int);
-  char * command_completion(char *, int);
+  char * command_completion(const char *, int);
 #endif
 
 /* maximum # of chars from progname to display in prompt */
@@ -124,7 +126,6 @@ char real_prompt[MAX_NAME+3];
 
 #if __STDC__
   char *ds(char *), *cat(char *, ...), *visible(int);
-  int getopt(int,char **,char *);
   int main(int, char **);
   int yywrap(void);
   int dostdin(void);
@@ -241,7 +242,7 @@ struct
 /* for unsupported combinations of types. */
 void mbcheck()
 {
-    register int i, j, restrict;
+    register int i, j, restriction;
     char *t1, *t2;
 
     /* Loop through the types */
@@ -258,26 +259,26 @@ void mbcheck()
 		if (!(modbits & crosstypes[j].bit))
 		    continue;
 		/* check the type of restriction */
-		restrict = crosscheck[i][j];
-		if (restrict == ALWAYS)
+		restriction = crosscheck[i][j];
+		if (restriction == ALWAYS)
 		    continue;
 		t1 = crosstypes[i].name;
 		t2 = crosstypes[j].name;
-		if (restrict == NEVER)
+		if (restriction == NEVER)
 		    {
 		    notsupported("", t1, t2);
 		    }
-		else if (restrict == RITCHIE)
+		else if (restriction == RITCHIE)
 		    {
 		    if (RitchieFlag)
 			notsupported(" (Ritchie Compiler)", t1, t2);
 		    }
-		else if (restrict == PREANSI)
+		else if (restriction == PREANSI)
 		    {
 		    if (PreANSIFlag || RitchieFlag)
 			notsupported(" (Pre-ANSI Compiler)", t1, t2);
 		    }
-		else if (restrict == ANSI)
+		else if (restriction == ANSI)
 		    {
 		    if (!RitchieFlag && !PreANSIFlag)
 			notsupported(" (ANSI Compiler)", t1, t2);
@@ -286,7 +287,7 @@ void mbcheck()
 		    {
 		    (void) fprintf (stderr,
 			"%s: Internal error in crosscheck[%d,%d]=%d!\n",
-			progname, i, j, restrict);
+			progname, i, j, restriction);
 		    exit(1); /* NOTREACHED */
 		    }
 		}
@@ -375,7 +376,7 @@ char *options[] = {
 static char *line_read = NULL;
 
 /* Read a string, and return a pointer to it.  Returns NULL on EOF. */
-char * getline ()
+char * get_line ()
 {
   /* If the buffer has already been allocated, return the memory
      to the free pool. */
@@ -395,16 +396,16 @@ char * getline ()
   return (line_read);
 }
 
-char ** attempt_completion(char *text, int start, int end)
+char ** attempt_completion(const char *text, int start, int end)
 {
   char **matches = NULL;
 
-  if (start == 0) matches = completion_matches(text, command_completion);
+  if (start == 0) matches = rl_completion_matches(text, command_completion);
 
   return matches;
 }
 
-char * command_completion(char *text, int flag)
+char * command_completion(const char *text, int flag)
 {
   static int index, len;
   char *command;
@@ -887,7 +888,7 @@ int dostdin()
 
 	if (!quiet) (void) printf("Type `help' or `?' for help\n");
 	ret = 0;
-	while ((line = getline())) {
+	while ((line = get_line())) {
 	    if (!strcmp(line, "quit") || !strcmp(line, "exit")) {
 		free(line);
 		return ret;
@@ -1251,8 +1252,8 @@ char **argv;
 
 #ifdef USE_READLINE
     /* install completion handlers */
-    rl_attempted_completion_function = (CPPFunction *)attempt_completion;
-    rl_completion_entry_function = (Function *)keyword_completion;
+    rl_attempted_completion_function = (rl_completion_func_t *)attempt_completion;
+    rl_completion_entry_function = (rl_compentry_func_t *)keyword_completion;
 #endif
 
     setprogname(argv[0]);