Skip to content

compile failure with gcc 9.3.0 on xubuntu #32

Open
wwwutz opened this issue Jan 17, 2022 · 1 comment · May be fixed by #33
Open

compile failure with gcc 9.3.0 on xubuntu #32

wwwutz opened this issue Jan 17, 2022 · 1 comment · May be fixed by #33
Assignees

Comments

@wwwutz
Copy link
Contributor

wwwutz commented Jan 17, 2022

git clone https://github.molgen.mpg.de/mariux64/bee
cd bee
make install
cd ..
git clone https://github.molgen.mpg.de/mariux64/bee-files
cd bee-files
./xdu.be0
[...]

[BEE] make PREFIX=/usr EPREFIX=/usr BINDIR=/usr/bin SBINDIR=/usr/sbin LIBEXECDIR=/usr/libexec SYSCONFDIR=/etc SHAREDSTATEDIR=/var LOCALSTATEDIR=/var LIBDIR=/usr/lib INCLUDEDIR=/usr/include DATAROOTDIR=/usr/share DATADIR=/usr/share INFODIR=/usr/share/info LOCALEDIR=/usr/share/locale MANDIR=/usr/share/man DOCDIR=/usr/share/doc/xdu
cc -Wall -Werror -Wextra -pedantic -std=gnu99 -O2 -g   -c -o xdu.o xdu.c
xdu.c: In function ‘printpath’:
xdu.c:733:5: error: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Werror=unused-result]
  733 |     asprintf(&path, "%s", np->name);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xdu.c:736:9: error: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Werror=unused-result]
  736 |         asprintf(&path, "%s/%s", np->parent->name, path);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: xdu.o] Error 1
root@baconseed:~/bee-files# cc --version
cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@niclas
Copy link
Contributor

niclas commented Jan 18, 2022

On mariux this error is not reproducible. Instead with that version of gcc I obtain another error:

$ git clone https://github.molgen.mpg.de/mariux64/xdu.git
$ cd xdu
$ source /package/pkg/gcc-7.4.0-0/profile 
$ make -B
cc -Wall -Werror -Wextra -pedantic -std=gnu99 -O2 -g   -c -o xdu.o xdu.c
cc -Wall -Werror -Wextra -pedantic -std=gnu99 -O2 -g   -c -o xwin.o xwin.c
cc -o xdu xdu.o xwin.o -lXaw -lXt -lX11
$ source /package/pkg/gcc-9.3.0-0/profile 
$ make -B
cc -Wall -Werror -Wextra -pedantic -std=gnu99 -O2 -g   -c -o xdu.o xdu.c
cc -Wall -Werror -Wextra -pedantic -std=gnu99 -O2 -g   -c -o xwin.o xwin.c
xwin.c: In function ‘xdrawrect’:
xwin.c:565:29: error: ‘%s’ directive writing up to 1023 bytes into a region of size 1022 [-Werror=format-overflow=]
  565 |         sprintf(label, "%s (%sG)", name, number_label);
      |                             ^~           ~~~~~~~~~~~~
xwin.c:565:9: note: ‘sprintf’ output 5 or more bytes (assuming 1028) into a destination of size 1024
  565 |         sprintf(label, "%s (%sG)", name, number_label);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xwin.c:570:29: error: ‘%s’ directive writing up to 1023 bytes into a region of size 1022 [-Werror=format-overflow=]
  570 |         sprintf(label, "%s (%sT)", name, number_label);
      |                             ^~           ~~~~~~~~~~~~
xwin.c:570:9: note: ‘sprintf’ output 5 or more bytes (assuming 1028) into a destination of size 1024
  570 |         sprintf(label, "%s (%sT)", name, number_label);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xwin.c:555:29: error: ‘%s’ directive writing up to 1023 bytes into a region of size 1022 [-Werror=format-overflow=]
  555 |         sprintf(label, "%s (%sk)", name, number_label);
      |                             ^~           ~~~~~~~~~~~~
xwin.c:555:9: note: ‘sprintf’ output 5 or more bytes (assuming 1028) into a destination of size 1024
  555 |         sprintf(label, "%s (%sk)", name, number_label);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xwin.c:560:29: error: ‘%s’ directive writing up to 1023 bytes into a region of size 1022 [-Werror=format-overflow=]
  560 |         sprintf(label, "%s (%sM)", name, number_label);
      |                             ^~           ~~~~~~~~~~~~
xwin.c:560:9: note: ‘sprintf’ output 5 or more bytes (assuming 1028) into a destination of size 1024
  560 |         sprintf(label, "%s (%sM)", name, number_label);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: xwin.o] Error 1

Maybe that would be found on xubuntu if xdu would have compiled successfully. I'm working on it.

@niclas niclas linked a pull request Jan 18, 2022 that will close this issue
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants