[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

__builtin_assume warnings

From: Mattias Engdegård
Subject: __builtin_assume warnings
Date: Wed, 12 Aug 2020 11:38:21 +0200

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 via email to

[Prev in Thread] Current Thread [Next in Thread]