From 64c27d12dab4d5a31103f48773733f17c84b0a77 Mon Sep 17 00:00:00 2001 From: Khem Raj 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 --- 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