unicorn/qemu/include/qemu
Philippe Mathieu-Daudé 24c56c65a3
qemu/compiler: Define QEMU_NONSTRING
GCC 8 introduced the -Wstringop-truncation checker to detect truncation by
the strncat and strncpy functions (closely related to -Wstringop-overflow,
which detect buffer overflow by string-modifying functions declared in
<string.h>).

In tandem of -Wstringop-truncation, the "nonstring" attribute was added:

The nonstring variable attribute specifies that an object or member
declaration with type array of char, signed char, or unsigned char,
or pointer to such a type is intended to store character arrays that
do not necessarily contain a terminating NUL. This is useful in detecting
uses of such arrays or pointers with functions that expect NUL-terminated
strings, and to avoid warnings when such an array or pointer is used as
an argument to a bounded string manipulation function such as strncpy.

From the GCC manual: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-nonstring-variable-attribute

Add the QEMU_NONSTRING macro which checks if the compiler supports this
attribute.

Backports commit 1daff2f8193496b0e5e0ab56dc48c570c81f804e from qemu
2019-01-22 15:06:09 -05:00
..
atomic.h atomics: Set ATOMIC_REG_SIZE=8 for MIPS n32 2019-01-05 07:26:14 -05:00
atomic128.h tcg: Split CONFIG_ATOMIC128 2018-10-23 15:17:39 -04:00
bitmap.h bitmap: provide to_le/from_le helpers 2018-03-05 01:11:13 -05:00
bitops.h i386: Fix up the Node id for CPUID_8000_001E 2018-07-03 00:31:38 -04:00
bswap.h bswap: Add new stn_*_p() and ldn_*_p() memory access functions 2018-06-15 12:17:21 -04:00
compiler.h qemu/compiler: Define QEMU_NONSTRING 2019-01-22 15:06:09 -05:00
cpuid.h util: Introduce include/qemu/cpuid.h 2018-03-09 12:12:00 -05:00
crc32c.h import 2015-08-21 15:04:50 +08:00
cutils.h cutils: Fix qemu_strtosz() & friends to reject non-finite sizes 2018-12-18 04:48:12 -05:00
fprintf-fn.h Clean up decorations and whitespace around header guards 2018-02-25 04:26:02 -05:00
host-utils.h includes: Replace QEMU_GNUC_PREREQ with "__has_builtin || !defined(__clang__)" 2018-12-18 03:55:43 -05:00
int128.h qemu/int128: Disable assert in int128.h 2018-09-03 09:54:59 -04:00
log.h tcg: Optionally log FPU state in TCG -d cpu logging 2018-05-15 22:31:08 -04:00
mmap-alloc.h Clean up ill-advised or unusual header guards 2018-02-25 04:22:46 -05:00
module.h cleanup qemu/include/qemu/module.h 2017-01-25 00:20:08 +08:00
osdep.h build-sys: build with Vista API by default 2019-01-13 20:28:51 -05:00
queue.h tcg: Dynamically allocate TCGOps 2018-03-05 16:34:40 -05:00
range.h range: pass const pointer where possible 2018-12-11 20:35:26 -05:00
sys_membarrier.h membarrier: add --enable-membarrier 2018-03-17 19:30:43 -04:00
thread-posix.h Clean up ill-advised or unusual header guards 2018-02-25 04:22:46 -05:00
thread-win32.h Clean up ill-advised or unusual header guards 2018-02-25 04:22:46 -05:00
thread.h Clean up ill-advised or unusual header guards 2018-02-25 04:22:46 -05:00
timer.h Drop remaining bits of ia64 host support 2018-03-09 11:54:57 -05:00
typedefs.h move ObjectClass to typedefs.h 2018-12-11 20:37:04 -05:00
units.h include: Add IEC binary prefixes in qemu/units.h 2018-07-03 19:47:19 -04:00
xxhash.h xxhash: match output against the original xxhash32 2018-12-18 06:09:01 -05:00