Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Eduardo =?iso-8859-1?Q?A=2E_Bustamante_L=F3pez?= Newsgroups: gnu.bash.bug Subject: Bash build issues in `devel' branch due to -Werror compiler flag Date: Sat, 15 Dec 2018 23:35:49 -0800 Lines: 155 Approved: bug-bash@gnu.org Message-ID: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1544945759 28394 208.118.235.17 (16 Dec 2018 07:35:59 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=+FQXCimeUbFif3ZEdY1dLsCogIEG/BynQmeW/6k0TaA=; b=UEYTn96p/coYdKVf5eBY4GydKOWpXxLXFjypoYoSOO1qppgxQjdcX7AvKY5BsgRaDh HOjGBMmGZifbGWULylNBflAOFLFPqJ2t/0WX8WsbCQ9c+4ON9XFS178xEDamkOPEeqFj 9ZASAs6e09irEyj/GuKko17+nMsxNLK+OBafLIpGaCQsa8ubOnvm4yNuRzpkfdG7eTeN 45pQAdAZwpE0XYK3FE3+9wRK31IDFqehPBo0WFEDuFQXaGMfkSTeVe2RafT70L5U8MZV 2smY64m/IOKrVICB6RqNoR8BV8VDqudb4zQfvGg7ob1GPuOaTqQ8DwKPcEVDFo1SbPa6 d9RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :mime-version:content-disposition:content-transfer-encoding :user-agent; bh=+FQXCimeUbFif3ZEdY1dLsCogIEG/BynQmeW/6k0TaA=; b=CEkwP+m92GI4SdJTQLTW2jpXd6yT5XlGpLIGIf7dEcvbCQQZGQXq5hen/heiI7a7rW nBupbGWFQWm5xv0u5z1Y3DkPVbPa03BwZdEf0h2Ty6UqG7fb1QBUpLLlgzAy1vQ2fI+V BH3uPFGPaTq/fiOouI18nm2QsMC7dnI746CI7Fga5CIRvAQcdfXAS2Vw5D9gegailGFT hqiJitnDz5x9EpReS5eLXh5hgNrou7TrqjCxA78uTnduTE2rxr077SbXATMVEbs81YyB 4gMle7DaTBkPZvjI8cHKf059Y5WY4NFKfp8ZjXpHseeOwpy1XxK49Rw5b7UunDzIATjR jbdw== X-Gm-Message-State: AA+aEWYdQewzYfbKGAHszFae1Q8c3uU+C86MDabSQsorwshDA83ksvgK Q57Pk3Ja+Iajxh6seTyq7UMKYo66 X-Google-Smtp-Source: AFSGD/VC8YpxOATZ8C1UtYEopoGDOpNCj89R//EuiiJBTjmYl8iY0m2zH6MZK/wNyWBoajJmf59tLA== X-Received: by 2002:a62:cf02:: with SMTP id b2mr9200964pfg.183.1544945751574; Sat, 15 Dec 2018 23:35:51 -0800 (PST) Mail-Followup-To: bug-bash@gnu.org Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52d X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14920 Commit 9d80be9ab5cc17011c634e0348c64c15fcba95bf adds the following compiler= flag: dualbus@debian:~/src/gnu/bash$ cat -n configure.ac | grep Werror -C3 1159 CFLAGS=3D"$CFLAGS -Wno-parentheses -Wno-format-security" 1160 if test -n "$DEBUG" 1161 then ~>1162 CFLAGS=3D"$CFLAGS -Werror" 1163 fi 1164 fi 1165=09 During build (with gcc): dualbus@debian:~/src/gnu/bash$ make -j$(nproc) -s make[1]: warning: -j4 forced in submake: resetting jobserver mode. ./parse.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] make[1]: warning: -j4 forced in submake: resetting jobserver mode. expr.c:217:17: error: conflicting types for built-in function =E2=80=98ex= p2=E2=80=99 [-Werror=3Dbuiltin-declaration-mismatch] static intmax_t exp2 __P((void)); ^~~~ cc1: all warnings being treated as errors I know the `exp2' function here has nothing to do with the built-in exponen= tial function, and that it has had that name for a long time, but the build brea= ks due to that. To hack around it, I renamed it from `exp2' to `exp22', and then it broke h= ere: dualbus@debian:~/src/gnu/bash$ make -j$(nproc) -s make[1]: warning: -j4 forced in submake: resetting jobserver mode. =20 *********************************************************** * * * GNU bash, version 5.0.0(1)-rc1 (x86_64-pc-linux-gnu) * * *********************************************************** =20 making lib/glob/libglob.a in ./lib/glob make[1]: warning: -j4 forced in submake: resetting jobserver mode. smatch.c: In function =E2=80=98_fnmatch_fallback_wc=E2=80=99: smatch.c:318:11: error: implicit declaration of function =E2=80=98fnmatch= =E2=80=99; did you mean =E2=80=98gmatch=E2=80=99? [-Werror=3Dimplicit-funct= ion-declaration] return (fnmatch ((const char *)w2, (const char *)w1, 0)); ^~~~~~~ gmatch Which I believe is an actual issue and I assume the fix is along the lines = of: dualbus@debian:~/src/gnu/bash$ git diff -- lib/ diff --git a/lib/glob/smatch.c b/lib/glob/smatch.c index 3826c93e..9150a28e 100644 --- a/lib/glob/smatch.c +++ b/lib/glob/smatch.c @@ -25,6 +25,7 @@ =20 #include "strmatch.h" #include +#include =20 #include "bashansi.h" #include "shmbutil.h" I'm not sure what to do about `exp2' though. Personally, I'd love for these functions to have slighly more meaningful names. I also tried clang version 7.0.1-+rc3-2, which gives an additional error: making lib/sh/libsh.a in ./lib/sh (...) getenv.c:55:7: error: comparison of nonnull parameter 'name' equal to a n= ull pointer is 'false' on first encounter [-Werror,-Wtautological-pointer-c= ompare] if (name =3D=3D 0 || *name =3D=3D '\0') ^~~~ ~ /usr/include/stdlib.h:631:50: note: declared 'nonnull' here extern char *getenv (const char *__name) __THROW __nonnull ((1)) __wur; ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:293:44: note: expanded from mac= ro '__nonnull' # define __nonnull(params) __attribute__ ((__nonnull__ params)) This is due to the stdlib.h header being pulled by bashansi.h in lib/sh/getenv.c, thus, providing a function signature that doesn't match Ba= sh's re-definition of getenv(): dualbus@debian:~/src/gnu/bash$ grep bashansi.h lib/sh/getenv.c=20 #include =20 dualbus@debian:~/src/gnu/bash$ grep stdlib.h bashansi.h=20 # include # include "ansi_stdlib.h" ~~~ Additional information: gcc: dualbus@debian:~/src/gnu/bash$ cc -v Using built-in specs. COLLECT_GCC=3Dcc COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper OFFLOAD_TARGET_NAMES=3Dnvptx-none OFFLOAD_TARGET_DEFAULT=3D1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Debian 8.2.0-12= ' --with-bugurl=3Dfile:///usr/share/doc/gcc-8/README.Bugs --enable-language= s=3Dc,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=3D/usr --with-gcc-maj= or-version-only --program-suffix=3D-8 --program-prefix=3Dx86_64-linux-gnu- = --enable-shared --enable-linker-build-id --libexecdir=3D/usr/lib --without-= included-gettext --enable-threads=3Dposix --libdir=3D/usr/lib --enable-nls = --with-sysroot=3D/ --enable-clocale=3Dgnu --enable-libstdcxx-debug --enable= -libstdcxx-time=3Dyes --with-default-libstdcxx-abi=3Dnew --enable-gnu-uniqu= e-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-d= efault-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=3D= auto --enable-multiarch --disable-werror --with-arch-32=3Di686 --with-abi= =3Dm64 --with-multilib-list=3Dm32,m64,mx32 --enable-multilib --with-tune=3D= generic --enable-offload-targets=3Dnvptx-none --without-cuda-driver --enabl= e-checking=3Drelease --build=3Dx86_64-linux-gnu --host=3Dx86_64-linux-gnu -= -target=3Dx86_64-linux-gnu Thread model: posix gcc version 8.2.0 (Debian 8.2.0-12)=20 clang: dualbus@debian:~/src/gnu/bash$ clang -v clang version 7.0.1-+rc3-2 (tags/RELEASE_701/rc3) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.= 4.0 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8 Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8 Candidate multilib: .;@m64 Selected multilib: .;@m64