summaryrefslogtreecommitdiffstats
path: root/recipes-core/busybox/busybox/0001-writing-to-a-const-variable-is-undefined-behavior-C9.patch
blob: 6b933da669d6e773400e09e1d747dab0263453f9 (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
From 64c27d12dab4d5a31103f48773733f17c84b0a77 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 16 Jan 2019 22:39:24 -0800
Subject: [PATCH] writing to a const variable is undefined behavior (C99 6.7.3
 paragraph 5).

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 include/libbb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/libbb.h b/include/libbb.h
index 3366df30f..6b925eb2d 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -2092,7 +2092,7 @@ struct globals;
 /* '*const' ptr makes gcc optimize code much better.
  * Magic prevents ptr_to_globals from going into rodata.
  * If you want to assign a value, use SET_PTR_TO_GLOBALS(x) */
-extern struct globals *const ptr_to_globals;
+extern struct globals *ptr_to_globals;
 /* At least gcc 3.4.6 on mipsel system needs optimization barrier */
 #define barrier() __asm__ __volatile__("":::"memory")
 #define SET_PTR_TO_GLOBALS(x) do { \
-- 
2.20.1