File: Make-function-pointer-types-consistent-with-the-implement.patch

package info (click to toggle)
fteqcc 3343%2Bsvn3400-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,164 kB
  • sloc: ansic: 56,690; makefile: 75; sh: 6
file content (42 lines) | stat: -rw-r--r-- 1,846 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
From: Simon McVittie <smcv@debian.org>
Date: Thu, 1 Aug 2024 08:45:33 +0100
Subject: Make function pointer types consistent with the implementation

Mismatched function pointer types are treated as an error by gcc 14:

qccmain.c: In function 'QCC_main':
qccmain.c:2733:19: error: assignment to 'void * (*)(hashtable_t *, char *)' {aka 'void * (*)(struct hashtable_s *, char *)'} from incompatible pointer type 'void * (*)(hashtable_t *, const char *)' {aka 'void * (*)(struct hashtable_s *, const char *)'} [-Wincompatible-pointer-types]
 2733 |         pHash_Get = &Hash_Get;

Bug-Debian: https://bugs.debian.org/1074971
Signed-off-by: Simon McVittie <smcv@debian.org>
---
 qcc.h         | 2 +-
 qcc_pr_comp.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qcc.h b/qcc.h
index 9579613..47a0256 100644
--- a/qcc.h
+++ b/qcc.h
@@ -914,6 +914,6 @@ char *TypeName(QCC_type_t *type);
 void QCC_PR_IncludeChunk (char *data, pbool duplicate, char *filename);
 void QCC_PR_IncludeChunkEx(char *data, pbool duplicate, char *filename, CompilerConstant_t *cnst);
 pbool QCC_PR_UnInclude(void);
-extern void *(*pHash_Get)(hashtable_t *table, char *name);
+extern void *(*pHash_Get)(hashtable_t *table, const char *name);
 extern void *(*pHash_GetNext)(hashtable_t *table, char *name, void *old);
 extern void *(*pHash_Add)(hashtable_t *table, char *name, void *data, bucket_t *);
diff --git a/qcc_pr_comp.c b/qcc_pr_comp.c
index 40020f6..93ceda3 100644
--- a/qcc_pr_comp.c
+++ b/qcc_pr_comp.c
@@ -124,7 +124,7 @@ int optres_logicops;
 int optres_test1;
 int optres_test2;
 
-void *(*pHash_Get)(hashtable_t *table, char *name);
+void *(*pHash_Get)(hashtable_t *table, const char *name);
 void *(*pHash_GetNext)(hashtable_t *table, char *name, void *old);
 void *(*pHash_Add)(hashtable_t *table, char *name, void *data, bucket_t *);