GNU bug report logs - #33544
gzip 1.9 alignment compile failure on cast

Previous Next

Package: gzip;

Reported by: "Adler, Mark" <madler <at> alumni.caltech.edu>

Date: Wed, 28 Nov 2018 19:24:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33544 in the body.
You can then email your comments to 33544 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gzip <at> gnu.org:
bug#33544; Package gzip. (Wed, 28 Nov 2018 19:24:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Adler, Mark" <madler <at> alumni.caltech.edu>:
New bug report received and forwarded. Copy sent to bug-gzip <at> gnu.org. (Wed, 28 Nov 2018 19:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Adler, Mark" <madler <at> alumni.caltech.edu>
To: "bug-gzip <at> gnu.org" <bug-gzip <at> gnu.org>
Subject: gzip 1.9 alignment compile failure on cast
Date: Wed, 28 Nov 2018 19:22:56 +0000
Compiling gzip 1.9 on macOS 10.13.6 using Xcode 10.1 with clang (Apple LLVM version 10.0.0 (clang-1000.11.45.5)), I get this error after ./configure and make:

memrchr.c:71:18: error: cast from 'const unsigned char *' to 'const longword *'
      (aka 'const unsigned long *') increases required alignment from 1 to 8
      [-Werror,-Wcast-align]
  longword_ptr = (const longword *) char_ptr;

I resolved it with this patch:

@@ -68,7 +68,7 @@ __memrchr (void const *s, int c_in, size_t n)
     if (*--char_ptr == c)
       return (void *) char_ptr;
 
-  longword_ptr = (const longword *) char_ptr;
+  longword_ptr = (const void *) char_ptr;
 
   /* All these elucidatory comments refer to 4-byte longwords,
      but the theory applies equally well to any size longwords.  */

Mark





Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sat, 01 Dec 2018 00:28:02 GMT) Full text and rfc822 format available.

Notification sent to "Adler, Mark" <madler <at> alumni.caltech.edu>:
bug acknowledged by developer. (Sat, 01 Dec 2018 00:28:02 GMT) Full text and rfc822 format available.

Message #10 received at 33544-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "Adler, Mark" <madler <at> alumni.caltech.edu>
Cc: Gnulib bugs <bug-gnulib <at> gnu.org>, 33544-done <at> debbugs.gnu.org
Subject: Re: bug#33544: gzip 1.9 alignment compile failure on cast
Date: Fri, 30 Nov 2018 16:27:23 -0800
[Message part 1 (text/plain, inline)]
Thanks, I installed the attached patch into Gnulib.
[0001-memrchr-port-better-to-clang.patch (text/x-patch, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 29 Dec 2018 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 116 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.