unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Compilation warning about PNTR_ADD
Date: Tue, 22 May 2018 13:08:04 -0700	[thread overview]
Message-ID: <5aba070d-52c7-b341-2fa9-cb87989910e0@cs.ucla.edu> (raw)
In-Reply-To: <831se3ebaq.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 178 bytes --]

Hmm, looks like a bug in the GCC grammar for function attributes, but if 
so it's a longstanding one as it's still in GCC 8. Anyway, I installed 
the attached to work around it.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Work-around-GCC-bug-with-function-attributes.patch --]
[-- Type: text/x-patch; name="0001-Work-around-GCC-bug-with-function-attributes.patch", Size: 1015 bytes --]

From 5b335e8ee195733b067562d9c4199829b08e8b49 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 22 May 2018 13:05:19 -0700
Subject: [PATCH] Work around GCC bug with function attributes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* src/alloc.c (PNTR_ADD): Put attributes after ‘static’ and before
returned type.  Problem reported by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2018-05/msg00559.html
---
 src/alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/alloc.c b/src/alloc.c
index d959c55350..4186347440 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -513,7 +513,7 @@ pointer_align (void *ptr, int alignment)
 
 #define macro_PNTR_ADD(p, i) ((p) + (i))
 
-static char * ATTRIBUTE_NO_SANITIZE_UNDEFINED ATTRIBUTE_UNUSED
+static ATTRIBUTE_NO_SANITIZE_UNDEFINED ATTRIBUTE_UNUSED char *
 PNTR_ADD (char *p, EMACS_UINT i)
 {
   return macro_PNTR_ADD (p, i);
-- 
2.17.0


  reply	other threads:[~2018-05-22 20:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 18:10 Compilation warning about PNTR_ADD Eli Zaretskii
2018-05-22 19:21 ` Paul Eggert
2018-05-22 19:32   ` Eli Zaretskii
2018-05-22 20:08     ` Paul Eggert [this message]
2018-05-23 14:51       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5aba070d-52c7-b341-2fa9-cb87989910e0@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).