all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Compilation warning about PNTR_ADD
@ 2018-05-22 18:10 Eli Zaretskii
  2018-05-22 19:21 ` Paul Eggert
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2018-05-22 18:10 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

This is with current master:

    CC       data.o
  alloc.c:517:1: warning: 'PNTR_ADD' defined but not used [-Wunused-function]
   PNTR_ADD (char *p, EMACS_UINT i)
   ^



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Compilation warning about PNTR_ADD
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggert @ 2018-05-22 19:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On 05/22/2018 11:10 AM, Eli Zaretskii wrote:
> This is with current master:
>
>      CC       data.o
>    alloc.c:517:1: warning: 'PNTR_ADD' defined but not used [-Wunused-function]
>     PNTR_ADD (char *p, EMACS_UINT i)
>     ^

What's the platform (which GCC version?), and how did you configure Emacs?




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Compilation warning about PNTR_ADD
  2018-05-22 19:21 ` Paul Eggert
@ 2018-05-22 19:32   ` Eli Zaretskii
  2018-05-22 20:08     ` Paul Eggert
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2018-05-22 19:32 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Tue, 22 May 2018 12:21:20 -0700
> 
> On 05/22/2018 11:10 AM, Eli Zaretskii wrote:
> > This is with current master:
> >
> >      CC       data.o
> >    alloc.c:517:1: warning: 'PNTR_ADD' defined but not used [-Wunused-function]
> >     PNTR_ADD (char *p, EMACS_UINT i)
> >     ^
> 
> What's the platform (which GCC version?), and how did you configure Emacs?

Sorry, here are the details (the compiler is MinGW GCC 5.3.0):

  GNU Emacs 27.0.50 (build 241, i686-pc-mingw32)
   of 2018-05-22 built on HOME-C4E4A596F7
  Repository revision: a51725280ac3f4db3b9a1a552f25fb4204f45a4d
  Windowing system distributor 'Microsoft Corp.', version 5.1.2600
  Recent messages:
  For information about GNU Emacs and the GNU system, type C-h C-a.

  Configured using:
   'configure --prefix=/d/usr --enable-checking=yes,glyphs --with-wide-int
   --with-modules --enable-check-lisp-object-type 'CFLAGS=-O0 -gdwarf-4
   -g3''

  Configured features:
  XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
  TOOLKIT_SCROLL_BARS MODULES THREADS JSON LCMS2

  Important settings:
    value of $LANG: ENU
    locale-coding-system: cp1255



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Compilation warning about PNTR_ADD
  2018-05-22 19:32   ` Eli Zaretskii
@ 2018-05-22 20:08     ` Paul Eggert
  2018-05-23 14:51       ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggert @ 2018-05-22 20:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

[-- 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: Compilation warning about PNTR_ADD
  2018-05-22 20:08     ` Paul Eggert
@ 2018-05-23 14:51       ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2018-05-23 14:51 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Tue, 22 May 2018 13:08:04 -0700
> 
> 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.

Thanks, it now compiles cleanly here.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-23 14:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2018-05-23 14:51       ` Eli Zaretskii

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.