sebastiencs / ls-icons

ls command with files icons
GNU General Public License v3.0
286 stars 16 forks source link

Make failed with error: function may return address of local variable #17

Open maxreuben opened 3 years ago

maxreuben commented 3 years ago

Make command failed with error as follows: $ sudo make make all-recursive make[1]: Entering directory '/home/reuben/Downloads/Programs/ls-icons' Making all in po make[2]: Entering directory '/home/reuben/Downloads/Programs/ls-icons/po' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/home/reuben/Downloads/Programs/ls-icons/po' Making all in . make[2]: Entering directory '/home/reuben/Downloads/Programs/ls-icons' CC src/chroot.o CC src/version.o AR src/libver.a CC lib/copy-acl.o CC lib/set-acl.o CC lib/acl-errno-valid.o CC lib/acl-internal.o CC lib/get-permissions.o CC lib/set-permissions.o CC lib/allocator.o CC lib/areadlink.o CC lib/areadlink-with-size.o CC lib/areadlinkat.o CC lib/argmatch.o CC lib/argv-iter.o CC lib/backupfile.o CC lib/backup-rename.o CC lib/backup-find.o CC lib/base32.o CC lib/base64.o CC lib/binary-io.o CC lib/bitrotate.o CC lib/c-strcasecmp.o CC lib/c-strncasecmp.o CC lib/c-strtod.o CC lib/c-strtold.o CC lib/canon-host.o CC lib/canonicalize.o CC lib/careadlinkat.o lib/careadlinkat.c: In function 'careadlinkat': cc1: error: function may return address of local variable [-Werror=return-local-addr] lib/careadlinkat.c:73:8: note: declared here 73 | char stack_buf[1024]; | ^~~~~ cc1: all warnings being treated as errors make[2]: [Makefile:10024: lib/careadlinkat.o] Error 1 make[2]: Leaving directory '/home/reuben/Downloads/Programs/ls-icons' make[1]: [Makefile:12675: all-recursive] Error 1 make[1]: Leaving directory '/home/reuben/Downloads/Programs/ls-icons' make: *** [Makefile:6835: all] Error 2

Before this, I ran "$ sudo ./configure --prefix=/opt/coreutils FORCE_UNSAFE_CONFIGURE=1". I did this as it gave me an error when i ran it without the flag as follows: $ sudo ./configure --prefix=/opt/coreutils ... checking whether mkfifo rejects trailing slashes... yes checking whether mknod can create fifo without root privileges... configure: error: in /home/reuben/Downloads/Programs/ls-icons': configure: **error:** you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check) Seeconfig.log' for more details

Before that, I'd run "$ export CC=clang CXX=clang++" and "$ ./bootstrap" as instructed

My system details:- $ uname -a Linux reubens-fedora 5.12.14-300.fc34.x86_64 #1 SMP Wed Jun 30 18:30:21 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux OS: Fedora 34 Terminal: Alacritty [0.8.0]

PS: it'd be great if someone could package it for non-debian based OSes instead of us having to build it from source. config.log

duard commented 2 years ago

Same erro here

test ! -f ./coreutils.pot || \
  test -z "af.gmo be.gmo bg.gmo ca.gmo cs.gmo da.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo eu.gmo fi.gmo fr.gmo ga.gmo gl.gmo hr.gmo hu.gmo ia.gmo id.gmo it.gmo ja.gmo kk.gmo ko.gmo lg.gmo lt.gmo ms.gmo nb.gmo nl.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo sk.gmo sl.gmo sr.gmo sv.gmo tr.gmo uk.gmo vi.gmo zh_CN.gmo zh_TW.gmo" || make af.gmo be.gmo bg.gmo ca.gmo cs.gmo da.gmo de.gmo el.gmo eo.gmo es.gmo et.gmo eu.gmo fi.gmo fr.gmo ga.gmo gl.gmo hr.gmo hu.gmo ia.gmo id.gmo it.gmo ja.gmo kk.gmo ko.gmo lg.gmo lt.gmo ms.gmo nb.gmo nl.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo sk.gmo sl.gmo sr.gmo sv.gmo tr.gmo uk.gmo vi.gmo zh_CN.gmo zh_TW.gmo
make[2]: Leaving directory '/home/duard/Downloads/ls-icons/po'
Making all in .
make[2]: Entering directory '/home/duard/Downloads/ls-icons'
  CC       src/chroot.o
  CC       src/version.o
  AR       src/libver.a
  CC       lib/copy-acl.o
  CC       lib/set-acl.o
  CC       lib/acl-errno-valid.o
  CC       lib/acl-internal.o
  CC       lib/get-permissions.o
  CC       lib/set-permissions.o
  CC       lib/allocator.o
  CC       lib/areadlink.o
  CC       lib/areadlink-with-size.o
  CC       lib/areadlinkat.o
  CC       lib/argmatch.o
  CC       lib/argv-iter.o
  CC       lib/backupfile.o
  CC       lib/backup-rename.o
  CC       lib/backup-find.o
  CC       lib/base32.o
  CC       lib/base64.o
  CC       lib/binary-io.o
  CC       lib/bitrotate.o
  CC       lib/buffer-lcm.o
  CC       lib/c-strcasecmp.o
  CC       lib/c-strncasecmp.o
  CC       lib/c-strtod.o
  CC       lib/c-strtold.o
  CC       lib/canon-host.o
  CC       lib/canonicalize.o
  CC       lib/careadlinkat.o
lib/careadlinkat.c: In function 'careadlinkat':
cc1: error: function may return address of local variable [-Werror=return-local-addr]
lib/careadlinkat.c:73:8: note: declared here
   73 |   char stack_buf[1024];
      |        ^~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:10027: lib/careadlinkat.o] Error 1
make[2]: Leaving directory '/home/duard/Downloads/ls-icons'
make[1]: *** [Makefile:12678: all-recursive] Error 1
make[1]: Leaving directory '/home/duard/Downloads/ls-icons'
make: *** [Makefile:6838: all] Error 2
levone1 commented 1 year ago

Ditto - Mint 21... Any ideas?

IDMB10 commented 1 year ago

Same error. Anyone could fix it?