Bug 1181921

Summary: GCC 11: xen package fails
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Liška <martin.liska>
Component: BasesystemAssignee: Charles Arnold <carnold>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 1181859    

Description Martin Liška 2021-02-08 07:55:30 UTC
The package fails here:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/xen/standard/x86_64

due to:
[   72s] linux.c:165:50: error: argument 7 of type 'const xen_pfn_t[]' {aka 'const long unsigned int[]'} declared as an ordinary array [-Werror=vla-parameter]
[   72s]   165 |                                  const xen_pfn_t arr[/*num*/], int err[/*num*/])
[   72s]       |                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
[   72s] In file included from linux.c:29:
[   72s] private.h:35:50: note: previously declared as a variable length array 'const xen_pfn_t[num]' {aka 'const long unsigned int[num]'}
[   72s]    35 |                                  const xen_pfn_t arr[num], int err[num]);
[   72s]       |                                  ~~~~~~~~~~~~~~~~^~~~~~~~
[   72s] linux.c:165:68: error: argument 8 of type 'int[]' declared as an ordinary array [-Werror=vla-parameter]
[   72s]   165 |                                  const xen_pfn_t arr[/*num*/], int err[/*num*/])
[   72s]       |                                                                ~~~~^~~~~~~~~~~~
[   72s] In file included from linux.c:29:
[   72s] private.h:35:64: note: previously declared as a variable length array 'int[num]'
[   72s]    35 |                                  const xen_pfn_t arr[num], int err[num]);
[   72s]       |                                                            ~~~~^~~~~~~~
[   72s] cc1: all warnings being treated as errors
Comment 1 OBSbugzilla Bot 2021-02-10 22:50:06 UTC
This is an autogenerated message for OBS integration:
This bug (1181921) was mentioned in
https://build.opensuse.org/request/show/871003 Factory / xen
Comment 2 Martin Liška 2021-02-11 08:31:16 UTC
Fixed in devel project.
Comment 5 Martin Liška 2021-03-17 09:13:07 UTC
I noticed one more Werror which happens with -O3. Would you be interested in fixed this one:
https://build.opensuse.org/package/live_build_log/home:marxin:home:marxin:gcc-periodic-testing-v2/xen/openSUSE_Tumbleweed/x86_64

...
[   53s] gcc  -m64 -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs   -O2 -fomit-frame-pointer -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ -MMD -MP -MF .xenstore_client.o.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  -O3 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type  -Wno-error -g -Werror -I. -include /home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/tools/xenstore/../../tools/config.h -I./include -I/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/tools/xenstore/../../tools/libs/evtchn/include -I/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/tools/xenstore/../../tools/include -I/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/tools/xenstore/../../tools/libxc/include -I/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/tools/xenstore/../../tools/libs/toollog/include -I/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/tools/xenstore/../../tools/include -I/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/tools/xenstore/../../tools/libs/foreignmemory/include -I/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/tools/xenstore/../../tools/include -I/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/tools/xenstore/../../tools/libs/devicemodel/include -I/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/tools/xenstore/../../tools/include -I/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/tools/xenstore/../../tools/include -D__XEN_TOOLS__ -I/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/tools/xenstore/../../tools/libs/toolcore/include -I/home/abuild/rpmbuild/BUILD/xen-4.14.1-testing/tools/xenstore/../../tools/include -DXEN_LIB_STORED="\"/var/lib/xenstored\"" -DXEN_RUN_STORED="\"/run/xenstored\""   -c -o xenstore_client.o xenstore_client.c 

[   53s] xenstore_client.c: In function 'output.constprop':
[   53s] xenstore_client.c:59:1: error: '__builtin___vsnprintf_chk' output truncated before the last format character [-Werror=format-truncation=]
[   53s]    59 | output(const char *fmt, ...) {
[   53s]       | ^~~~~~
[   53s] In file included from /usr/include/stdio.h:866,
[   53s]                  from xenstore_client.c:16:
[   53s] /usr/include/bits/stdio2.h:85:10: note: '__builtin___vsnprintf_chk' output 2 or more bytes into a destination of size 1
[   53s]    85 |   return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
[   53s]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   53s]    86 |                                     __glibc_objsize (__s), __fmt, __ap);
[   53s]       |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   53s] xenstore_client.c: In function 'do_chmod':
[   53s] xenstore_client.c:285:51: error: '__builtin___snprintf_chk' output may be truncated before the last format character [-Werror=format-truncation=]
[   53s]   285 |                 snprintf(buf, MAX_PATH_LEN, "%s/%s", path, xsval[i]);
[   53s]       |                                                   ^
[   53s] In file included from /usr/include/stdio.h:866,
[   53s]                  from xenstore_client.c:16:
[   53s] /usr/include/bits/stdio2.h:71:10: note: '__builtin___snprintf_chk' output 2 or more bytes (assuming 257) into a destination of size 256
[   53s]    71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
[   53s]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   53s]    72 |                                    __glibc_objsize (__s), __fmt,
[   53s]       |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   53s]    73 |                                    __va_arg_pack ());
[   53s]       |                                    ~~~~~~~~~~~~~~~~~
[   53s] xenstore_client.c:285:51: error: '__builtin___snprintf_chk' output may be truncated before the last format character [-Werror=format-truncation=]
[   53s]   285 |                 snprintf(buf, MAX_PATH_LEN, "%s/%s", path, xsval[i]);
[   53s]       |                                                   ^
[   53s] In file included from /usr/include/stdio.h:866,
[   53s]                  from xenstore_client.c:16:
[   53s] /usr/include/bits/stdio2.h:71:10: note: '__builtin___snprintf_chk' output 2 or more bytes (assuming 257) into a destination of size 256
[   53s]    71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
[   53s]       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   53s]    72 |                                    __glibc_objsize (__s), __fmt,
[   53s]       |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   53s]    73 |                                    __va_arg_pack ());
[   53s]       |                                    ~~~~~~~~~~~~~~~~~