mirror of
https://abf.rosa.ru/djam/glibc40.git
synced 2025-02-23 15:52:52 +00:00

``` DEBUG: strcoll_l.c:184:24: error: 'seq2.save_idx' may be used uninitialized in this function [-Werror=maybe-uninitialized] DEBUG: 184 | len = weights[idx++]; DEBUG: | ~~~^~ ```
48 lines
4.5 KiB
Diff
48 lines
4.5 KiB
Diff
Apply -Wmaybe-uninitialized when building without -Os
|
|
|
|
Macro DIAG_IGNORE_Os_NEEDS_COMMENT works only with -Os, DIAG_IGNORE_NEEDS_COMMENT works always
|
|
|
|
DEBUG: gcc -fuse-ld=bfd -fomit-frame-pointer strcoll_l.c -c -std=gnu11 -fgnu89-inline -funwind-tables -fasynchronous-unwind-tables -O3 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -march=i686 -mtune=generic -msse -mfpmath=sse -fasynchronous-unwind-tables -mstackrealign -march=i686 -msse -mfpmath=sse -mtune=generic -Wp,-D_GLIBCXX_ASSERTIONS -DNDEBUG=1 -fstack-clash-protection -O3 -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -fstack-protector-strong --param=ssp-buffer-size=4 -march=i686 -mtune=generic -msse -mfpmath=sse -fasynchronous-unwind-tables -mstackrealign -O3 -Wno-error=stringop-overflow -fno-strict-aliasing -Wformat -fno-lto -mno-tls-direct-seg-refs -Wno-error -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fstack-protector-strong -fno-common -Wstrict-prototypes -Wold-style-definition -fmath-errno -fomit-frame-pointer -fomit-frame-pointer -fpie -ftls-model=initial-exec -U_FORTIFY_SOURCE -I../include -I/builddir/build/BUILD/glibc-4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c/build-i686-linux/string -I/builddir/build/BUILD/glibc-4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c/build-i686-linux -I../sysdeps/unix/sysv/linux/i386/i686 -I../sysdeps/i386/i686/nptl -I../sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/x86/include -I../sysdeps/unix/sysv/linux/x86 -I../sysdeps/x86/nptl -I../sysdeps/i386/nptl -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux -I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu/multiarch -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686/multiarch -I../sysdeps/i386/i686 -I../sysdeps/i386/fpu -I../sysdeps/x86/fpu -I../sysdeps/i386 -I../sysdeps/x86/include -I../sysdeps/x86 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/float128 -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i686-rosa-linux-gnu/11.2.0/include -isystem /usr/include -D_LIBC_REENTRANT -include /builddir/build/BUILD/glibc-4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c/build-i686-linux/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h -DPIC -DTOP_NAMESPACE=glibc -o /builddir/build/BUILD/glibc-4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c/build-i686-linux/string/strcoll_l.o -MD -MP -MF /builddir/build/BUILD/glibc-4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c/build-i686-linux/string/strcoll_l.o.dt -MT /builddir/build/BUILD/glibc-4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c/build-i686-linux/string/strcoll_l.o
|
|
DEBUG: In file included from strcoll_l.c:42:
|
|
DEBUG: strcoll_l.c: In function '__strcoll_l':
|
|
DEBUG: ../locale/weight.h:148:33: error: 'seq2.back_us' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|
|
DEBUG: 148 | offset += usrc[cnt] - cp[cnt];
|
|
DEBUG: | ~~~~^~~~~
|
|
|
|
Reported to upstream: https://sourceware.org/bugzilla/show_bug.cgi?id=29979
|
|
|
|
--- a/locale/weight.h
|
|
+++ b/locale/weight.h
|
|
@@ -144,7 +144,7 @@
|
|
is impossible for the same reason as described
|
|
above. */
|
|
DIAG_PUSH_NEEDS_COMMENT;
|
|
- DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
|
|
+ DIAG_IGNORE_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
|
|
offset += usrc[cnt] - cp[cnt];
|
|
DIAG_POP_NEEDS_COMMENT;
|
|
}
|
|
|
|
--- a/locale/weightwc.h
|
|
+++ b/locale/weightwc.h
|
|
@@ -102,7 +102,7 @@
|
|
might be used uninitialized. This is impossible for the
|
|
same reason as described above. */
|
|
DIAG_PUSH_NEEDS_COMMENT;
|
|
- DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
|
|
+ DIAG_IGNORE_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
|
|
for (cnt = 0; cnt < nhere - 1 && cnt < len; ++cnt)
|
|
if (cp[cnt] != usrc[cnt])
|
|
break;
|
|
|
|
--- a/string/strcoll_l.c
|
|
+++ b/string/strcoll_l.c
|
|
@@ -180,7 +180,7 @@
|
|
ensures that seq->save_idx was saved to first and contains a
|
|
valid value. */
|
|
DIAG_PUSH_NEEDS_COMMENT;
|
|
- DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
|
|
+ DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
|
|
len = weights[idx++];
|
|
DIAG_POP_NEEDS_COMMENT;
|
|
/* Skip over indices of previous levels. */
|