all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: __builtin_assume warnings
Date: Wed, 12 Aug 2020 11:38:21 +0200	[thread overview]
Message-ID: <B7293869-E00B-45C3-ACBE-3324CB168B9D@acm.org> (raw)

Building on macOS with Apple clang version 11.0.0 (clang-1100.0.33.17) now gives a stream of warnings about:

In file included from ../../emacs/src/dispnew.c:27:
../../emacs/src/lisp.h:1812:12: warning: the argument to '__builtin_assume' has
      side effects that will be discarded [-Wassume]
  eassume (0 <= i && i < bool_vector_size (a));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../emacs/src/lisp.h:182:32: note: expanded from macro 'eassume'
# define eassume(cond) assume (cond)
                               ^~~~
../../emacs/lib/verify.h:305:38: note: expanded from macro 'assume'
# define assume(R) __builtin_assume (R)
                                     ^

We could build with -Wno-assume, or alter the definition of 'assume' to

# define assume(R) _Pragma("clang diagnostic push")                     \
                   _Pragma("clang diagnostic ignored \"-Wassume\"")     \
                   __builtin_assume (R)                                 \
                   _Pragma("clang diagnostic pop")

but neither seems entirely satisfactory.




             reply	other threads:[~2020-08-12  9:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12  9:38 Mattias Engdegård [this message]
2020-08-15  2:32 ` __builtin_assume warnings Paul Eggert
2020-08-16  8:23   ` Mattias Engdegård
2020-08-17 14:05     ` Mattias Engdegård
2020-08-17 22:11       ` Paul Eggert
2020-08-18  7:11         ` Mattias Engdegård
2020-08-18 22:53           ` Paul Eggert
2020-08-19  8:01             ` Mattias Engdegård

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

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

  git send-email \
    --in-reply-to=B7293869-E00B-45C3-ACBE-3324CB168B9D@acm.org \
    --to=mattiase@acm.org \
    --cc=eggert@cs.ucla.edu \
    --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 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.