From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9670 invoked by alias); 21 Sep 2015 12:57:04 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36577 Received: (qmail 13762 invoked from network); 21 Sep 2015 12:57:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-AuditID: cbfec7f4-f79c56d0000012ee-56-55fffc408261 Date: Mon, 21 Sep 2015 13:46:46 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Two issues found with -fsanitize=undefined Message-id: <20150921134646.57c0e6d0@pwslap01u.europe.root.pri> In-reply-to: <20150919205751.5338bddc@ntlworld.com> References: <20150917075759.GA24365@x4> <20150919205751.5338bddc@ntlworld.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsVy+t/xy7oOf/6HGnQ8V7I42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGQ/nfmUruMpT0d/6h72BcSVXFyMnh4SAicTGxtnsELaYxIV7 69m6GLk4hASWMkrs2H+cFcKZwSRxbMceKGcbo0Tbgs/MIC0sAqoSx591gbWzCRhKTN00mxHE FhEQlzi79jwLiC0sYC4xb/8eNhCbV8Be4tjnj0wgNqeAscT03n1gvUICfhKre46CzeQX0Je4 +vcTE8RJ9hIzr5xhhOgVlPgx+R7YTGYBLYnN25pYIWx5ic1r3jJDzFGXuHF3N/sERqFZSFpm IWmZhaRlASPzKkbR1NLkguKk9FxDveLE3OLSvHS95PzcTYyQsP2yg3HxMatDjAIcjEo8vA4C /0OFWBPLiitzDzFKcDArifDqzAIK8aYkVlalFuXHF5XmpBYfYpTmYFES5527632IkEB6Yklq dmpqQWoRTJaJg1OqgXHZqVc1TI3XBcRf7++/uC3uc7uy6tK3YscW7lz/c8M/0Wgh9qCC6Uwn GuosXDczSiyfOkViYSCv6tybdn78LbMMf55cVZMz8UAil/3C4AfCVmFbGlN3tMvrSHqs+eKw zrb8MMcfvSlNAh47F2pcfphd08x2rWJfb6pL84e9CU++Tg44Xm+g1KfEUpyRaKjFXFScCABB JLkBVwIAAA== On Sat, 19 Sep 2015 20:57:51 +0100 Peter Stephenson wrote: > --- a/Src/zsh.h > +++ b/Src/zsh.h > @@ -36,6 +36,12 @@ > */ > #ifdef ZSH_64_BIT_TYPE > typedef ZSH_64_BIT_TYPE zlong; > +#if defind(ZLONG_IS_LONG_LONG) && defined(LLONG_MAX) I've fixed this, which broke compilation on 32-bit systems with 64-bit long long. Here's a patch to neaten up the case (removing a magic number) where zlong is a 64-bit long. pws diff --git a/Src/zsh.h b/Src/zsh.h index b98fc5c..dd05961 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -39,9 +39,13 @@ typedef ZSH_64_BIT_TYPE zlong; #if defined(ZLONG_IS_LONG_LONG) && defined(LLONG_MAX) #define ZLONG_MAX LLONG_MAX #else +#ifdef ZLONG_IS_LONG_64 +#define ZLONG_MAX LONG_MAX +#else /* umm... */ #define ZLONG_MAX ((zlong)9223372036854775807) #endif +#endif #ifdef ZSH_64_BIT_UTYPE typedef ZSH_64_BIT_UTYPE zulong; #else diff --git a/configure.ac b/configure.ac index d7db8ba..c3bd713 100644 --- a/configure.ac +++ b/configure.ac @@ -1079,9 +1079,15 @@ main() { return sizeof(ino_t) < 8; } fi AH_TEMPLATE([ZLONG_IS_LONG_LONG], [Define to 1 if the zlong type uses long long int.]) +AH_TEMPLATE([ZLONG_IS_LONG_64], +[Define to 1 if the zlong type uses 64-bit long int.]) if test "$zsh_cv_64_bit_type" = "long long"; then dnl Remember this so we can get (s)printf output right. AC_DEFINE(ZLONG_IS_LONG_LONG) +else + if test "$zsh_cv_64_bit_type" = "long"; then + AC_DEFINE(ZLONG_IS_LONG_64) + fi fi dnl We'll blithely assume (f)printf supports the same types as sprintf.