This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 7/7] Fix invalid left shift of negative value.
- From: Dominik Vogt <vogt at linux dot vnet dot ibm dot com>
- To: binutils at sourceware dot org
- Cc: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Mon, 9 Nov 2015 16:34:26 +0100
- Subject: Re: [PATCH 7/7] Fix invalid left shift of negative value.
- Authentication-results: sourceware.org; auth=none
- References: <20151030143814 dot GA18070 at linux dot vnet dot ibm dot com> <20151030144506 dot GG18875 at linux dot vnet dot ibm dot com>
- Reply-to: vogt at linux dot vnet dot ibm dot com
On Fri, Oct 30, 2015 at 03:45:06PM +0100, Dominik Vogt wrote:
> On Fri, Oct 30, 2015 at 03:38:15PM +0100, Dominik Vogt wrote:
> > The following series of patches fixes all occurences of
> > left-shifting negative constants in C code which is undefined by
> > the C standard. The patches have been tested on s390x, covering
> > only a small subset of the changes.
>
> Changes in zlib/. This is only one change in a source code
> comment.
Any optinions on this patch?
> >From d5fa58a46d83819611e199cb339fd94913f741b8 Mon Sep 17 00:00:00 2001
> From: Dominik Vogt <vogt@linux.vnet.ibm.com>
> Date: Fri, 30 Oct 2015 15:20:03 +0100
> Subject: [PATCH 7/7] zlib: Fix left shift of negative value.
>
> (Updated just a comment; no code changed)
> ---
> zlib/zlib.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/zlib/zlib.h b/zlib/zlib.h
> index 3edf3ac..b524487 100644
> --- a/zlib/zlib.h
> +++ b/zlib/zlib.h
> @@ -941,7 +941,7 @@ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
> location in the input stream can be determined from avail_in and data_type
> as noted in the description for the Z_BLOCK flush parameter for inflate.
>
> - inflateMark returns the value noted above or -1 << 16 if the provided
> + inflateMark returns the value noted above or -(1 << 16) if the provided
> source stream state was inconsistent.
> */
>
> --
> 2.3.0
>
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
IBM Germany