]> git.armaanb.net Git - asd-repo.git/blob - busybox/patches/fix-UB+clang.patch
mutt: remove /etc/Mutt*
[asd-repo.git] / busybox / patches / fix-UB+clang.patch
1 diff --git a/coreutils/test.c b/coreutils/test.c
2 index 7c65743..ac0ac4e 100644
3 --- a/coreutils/test.c
4 +++ b/coreutils/test.c
5 @@ -435,7 +435,7 @@ struct test_statics {
6  };
7  
8  /* See test_ptr_hack.c */
9 -extern struct test_statics *const test_ptr_to_statics;
10 +extern struct test_statics *test_ptr_to_statics;
11  
12  #define S (*test_ptr_to_statics)
13  #define args            (S.args         )
14 diff --git a/include/libbb.h b/include/libbb.h
15 index cae5465..adbf4b8 100644
16 --- a/include/libbb.h
17 +++ b/include/libbb.h
18 @@ -342,7 +342,7 @@ struct BUG_off_t_size_is_misdetected {
19  #if defined(errno)
20  /* If errno is a define, assume it's "define errno (*__errno_location())"
21   * and we will cache it's result in this variable */
22 -extern int *const bb_errno;
23 +extern int *bb_errno;
24  #undef errno
25  #define errno (*bb_errno)
26  #define bb_cached_errno_ptr 1
27 @@ -2228,7 +2228,7 @@ struct globals;
28  /* '*const' ptr makes gcc optimize code much better.
29   * Magic prevents ptr_to_globals from going into rodata.
30   * If you want to assign a value, use SET_PTR_TO_GLOBALS(x) */
31 -extern struct globals *const ptr_to_globals;
32 +extern struct globals *ptr_to_globals;
33  
34  #if defined(__clang_major__) && __clang_major__ >= 9
35  /* Clang/llvm drops assignment to "constant" storage. Silently.
36 diff --git a/libbb/lineedit.c b/libbb/lineedit.c
37 index 75de88e..78ad893 100644
38 --- a/libbb/lineedit.c
39 +++ b/libbb/lineedit.c
40 @@ -192,7 +192,7 @@ struct lineedit_statics {
41  };
42  
43  /* See lineedit_ptr_hack.c */
44 -extern struct lineedit_statics *const lineedit_ptr_to_statics;
45 +extern struct lineedit_statics * lineedit_ptr_to_statics;
46  
47  #define S (*lineedit_ptr_to_statics)
48  #define state            (S.state           )
49 diff --git a/shell/ash.c b/shell/ash.c
50 index f16d7fb..0eff957 100644
51 --- a/shell/ash.c
52 +++ b/shell/ash.c
53 @@ -300,10 +300,9 @@ typedef long arith_t;
54   * set "-DBB_GLOBAL_CONST=''" in CONFIG_EXTRA_CFLAGS to disable
55   * this optimization.
56   */
57 -#ifndef BB_GLOBAL_CONST
58 -# define BB_GLOBAL_CONST const
59 -#endif
60  
61 +#undef BB_GLOBAL_CONST
62 +#define BB_GLOBAL_CONST
63  
64  /* ============ Hash table sizes. Configurable. */
65