summaryrefslogtreecommitdiff
path: root/gcc10-fixes.patch
blob: 409fb74bb367f2c56d4d8be1e3cccc7d58cdd2f7 (plain)
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
References: bsc#1158414

For libxlu_pci.c
libxlu_pci.c: In function 'xlu_pci_parse_bdf':
libxlu_pci.c:32:18: error: 'func' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   32 |     pcidev->func = func;
      |     ~~~~~~~~~~~~~^~~~~~
libxlu_pci.c:51:29: note: 'func' was declared here
   51 |     unsigned dom, bus, dev, func, vslot = 0;
      |                             ^~~~
libxlu_pci.c:31:17: error: 'dev' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   31 |     pcidev->dev = dev;
      |     ~~~~~~~~~~~~^~~~~
libxlu_pci.c:51:24: note: 'dev' was declared here
   51 |     unsigned dom, bus, dev, func, vslot = 0;
      |                        ^~~
libxlu_pci.c:30:17: error: 'bus' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   30 |     pcidev->bus = bus;
      |     ~~~~~~~~~~~~^~~~~
libxlu_pci.c:51:19: note: 'bus' was declared here
   51 |     unsigned dom, bus, dev, func, vslot = 0;
      |                   ^~~
libxlu_pci.c:29:20: error: 'dom' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   29 |     pcidev->domain = domain;
      |     ~~~~~~~~~~~~~~~^~~~~~~~
libxlu_pci.c:51:14: note: 'dom' was declared here
   51 |     unsigned dom, bus, dev, func, vslot = 0;
      |              ^~~


For kdd.c
kdd.c: In function 'kdd_tx':
kdd.c:408:30: error: array subscript 65534 is outside the bounds of an interior zero-length array 'uint8_t[0]' {aka 'unsigned char[0]'} [-Werror=zero-length-bounds]
  408 |         sum += s->txp.payload[i];
      |                ~~~~~~~~~~~~~~^~~
In file included from kdd.c:52:
kdd.h:326:17: note: while referencing 'payload'
  326 |         uint8_t payload[0];
      |                 ^~~~~~~
cc1: all warnings being treated as errors


For ssl_tls.c
ssl_tls.c: In function 'ssl_session_reset':
ssl_tls.c:1778:5: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
 1778 |     memset( ssl->ctx_enc, 0, 128 );
      |     ^~~~~~
ssl_tls.c:1779:5: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
 1779 |     memset( ssl->ctx_dec, 0, 128 );
      |     ^~~~~~
ssl_tls.c: In function 'ssl_encrypt_buf':
ssl_tls.c:633:68: warning: this statement may fall through [-Wimplicit-fallthrough=]
  633 |              ssl->session->ciphersuite == SSL_RSA_CAMELLIA_256_SHA ||
ssl_tls.c:643:13: note: here
  643 |             default:
      |             ^~~~~~~
ssl_tls.c: In function 'ssl_decrypt_buf':
ssl_tls.c:738:68: warning: this statement may fall through [-Wimplicit-fallthrough=]
  738 |              ssl->session->ciphersuite == SSL_RSA_CAMELLIA_256_SHA ||
ssl_tls.c:748:13: note: here
  748 |             default:
      |             ^~~~~~~

For xenstored_core.h
ld: /home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/xenstored.a(xenstored_watch.o):/home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/xenstored_core.h:207: multiple definition of `xgt_handle'; /home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/xenstored.a(xenstored_core.o):/home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/xenstored_core.h:207: first defined here


For utils.h
ld: /home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/xenstored.a(xenstored_watch.o):/home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/utils.h:27: multiple definition of `xprintf'; /home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/xenstored.a(xenstored_core.o):/home/abuild/rpmbuild/BUILD/xen-4.13.0-testing/stubdom/xenstore/utils.h:27: first defined here


for libxl_utils.h
specified bound 108 equals destination size [-Werror=stringop-truncation]


xenpmd.c: In function 'get_next_battery_file':
xenpmd.c:92:37: error: '%s' directive output may be truncated writing between 4 and 2147483645 bytes into a region of size 271 [-Werror=format-truncation=]
   92 |     #define BATTERY_STATE_FILE_PATH "/tmp/battery/%s/state"
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
xenpmd.c:117:52: note: in expansion of macro 'BATTERY_STATE_FILE_PATH'
  117 |             snprintf(file_name, sizeof(file_name), BATTERY_STATE_FILE_PATH,
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~


Index: xen-4.13.0-testing/tools/libxl/libxlu_pci.c
===================================================================
--- xen-4.13.0-testing.orig/tools/libxl/libxlu_pci.c
+++ xen-4.13.0-testing/tools/libxl/libxlu_pci.c
@@ -22,6 +22,9 @@ static int hex_convert(const char *str,
     return 0;
 }
 
+#if __GNUC__ >= 10
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
 static int pcidev_struct_fill(libxl_device_pci *pcidev, unsigned int domain,
                                unsigned int bus, unsigned int dev,
                                unsigned int func, unsigned int vdevfn)
Index: xen-4.13.0-testing/tools/debugger/kdd/kdd.c
===================================================================
--- xen-4.13.0-testing.orig/tools/debugger/kdd/kdd.c
+++ xen-4.13.0-testing/tools/debugger/kdd/kdd.c
@@ -396,6 +396,9 @@ static void find_os(kdd_state *s)
  */
 
 
+#if __GNUC__ >= 10
+#pragma GCC diagnostic ignored "-Wzero-length-bounds"
+#endif
 /* Send a serial packet */
 static void kdd_tx(kdd_state *s)
 {
Index: xen-4.13.0-testing/stubdom/polarssl.patch
===================================================================
--- xen-4.13.0-testing.orig/stubdom/polarssl.patch
+++ xen-4.13.0-testing/stubdom/polarssl.patch
@@ -62,3 +62,25 @@ diff -Naur polarssl-1.1.4/library/bignum
              t_udbl r;
 
              r  = (t_udbl) X.p[i] << biL;
+--- polarssl-1.1.4/library/ssl_tls.c.orig	2012-05-30 01:39:36.000000000 -0600
++++ polarssl-1.1.4/library/ssl_tls.c	2020-03-10 10:17:26.270755351 -0600
+@@ -487,6 +487,9 @@ static void ssl_mac_sha1( unsigned char
+     sha1_finish( &sha1, buf + len );
+ }
+
++#if __GNUC__ >= 10
++#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
++#endif
+ /*
+  * Encryption/decryption functions
+  */
+@@ -1739,6 +1742,9 @@ int ssl_init( ssl_context *ssl )
+     return( 0 );
+ }
+
++#if __GNUC__ >= 10
++#pragma GCC diagnostic ignored "-Wmemset-elt-size"
++#endif
+ /*
+  * Reset an initialized and used SSL context for re-use while retaining
+  * all application-set variables, function pointers and data.
Index: xen-4.13.0-testing/tools/xenstore/xenstored_core.h
===================================================================
--- xen-4.13.0-testing.orig/tools/xenstore/xenstored_core.h
+++ xen-4.13.0-testing/tools/xenstore/xenstored_core.h
@@ -204,7 +204,11 @@ void finish_daemonize(void);
 /* Open a pipe for signal handling */
 void init_pipe(int reopen_log_pipe[2]);
 
+#if __GNUC__ >= 10
+extern xengnttab_handle **xgt_handle;
+#else
 xengnttab_handle **xgt_handle;
+#endif
 
 int remember_string(struct hashtable *hash, const char *str);
 
Index: xen-4.13.0-testing/tools/xenstore/utils.h
===================================================================
--- xen-4.13.0-testing.orig/tools/xenstore/utils.h
+++ xen-4.13.0-testing/tools/xenstore/utils.h
@@ -24,7 +24,11 @@ static inline bool strends(const char *a
 void barf(const char *fmt, ...) __attribute__((noreturn));
 void barf_perror(const char *fmt, ...) __attribute__((noreturn));
 
+#if __GNUC__ >= 10
+extern void (*xprintf)(const char *fmt, ...);
+#else
 void (*xprintf)(const char *fmt, ...);
+#endif
 
 #define eprintf(_fmt, _args...) xprintf("[ERR] %s" _fmt, __FUNCTION__, ##_args)
 
Index: xen-4.13.0-testing/tools/libxl/libxl_utils.c
===================================================================
--- xen-4.13.0-testing.orig/tools/libxl/libxl_utils.c
+++ xen-4.13.0-testing/tools/libxl/libxl_utils.c
@@ -1248,6 +1248,9 @@ int libxl__random_bytes(libxl__gc *gc, u
     return ret;
 }
 
+#if __GNUC__ >= 10
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
+#endif
 int libxl__prepare_sockaddr_un(libxl__gc *gc,
                                struct sockaddr_un *un, const char *path,
                                const char *what)
Index: xen-4.13.0-testing/tools/xenpmd/xenpmd.c
===================================================================
--- xen-4.13.0-testing.orig/tools/xenpmd/xenpmd.c
+++ xen-4.13.0-testing/tools/xenpmd/xenpmd.c
@@ -86,6 +86,9 @@ struct battery_status {
 
 static struct xs_handle *xs;
 
+#if __GNUC__ >= 10
+#pragma GCC diagnostic ignored "-Wformat-truncation"
+#endif
 #ifdef RUN_IN_SIMULATE_MODE
     #define BATTERY_DIR_PATH "/tmp/battery"
     #define BATTERY_INFO_FILE_PATH "/tmp/battery/%s/info"