summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-05-05 00:48:48 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-05-05 00:51:24 -0700
commitdaab2d3a62ac8fb1c74987e614cee93dc79fab74 (patch)
treefc99d947426af5724655edfd671a467430f7c7df /src
parent2db70edd9cc8b52cb32c97fe2ff0ae008f02a31c (diff)
downloademacs-daab2d3a62ac8fb1c74987e614cee93dc79fab74.tar.gz
Fix typos in recent attribute.h simplification
Problem reported by Andreas Schwab in: https://lists.gnu.org/r/emacs-devel/2020-05/msg00650.html * src/conf_post.h (HAS_ATTR_no_sanitize): Define to false in case cpp is picky, fixing a longstanding glitch here. (ATTRIBUTE_NO_SANITIZE_ADDRESS, ATTRIBUTE_NO_SANITIZE_UNDEFINED): Use HAS_ATTRIBUTE, not __has_attribute.
Diffstat (limited to 'src')
-rw-r--r--src/conf_post.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/conf_post.h b/src/conf_post.h
index 953b783ebea..1ef4ff33428 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -77,6 +77,7 @@ typedef bool bool_bf;
# define HAS_ATTRIBUTE(a) HAS_ATTR_##a
# define HAS_ATTR_cleanup GNUC_PREREQ (3, 4, 0)
# define HAS_ATTR_no_address_safety_analysis false
+# define HAS_ATTR_no_sanitize false
# define HAS_ATTR_no_sanitize_address GNUC_PREREQ (4, 8, 0)
# define HAS_ATTR_no_sanitize_undefined GNUC_PREREQ (4, 9, 0)
#endif
@@ -294,10 +295,10 @@ extern int emacs_setenv_TZ (char const *);
/* Attribute of functions whose code should not have addresses
sanitized. */
-#if __has_attribute (no_sanitize_address)
+#if HAS_ATTRIBUTE (no_sanitize_address)
# define ATTRIBUTE_NO_SANITIZE_ADDRESS \
__attribute__ ((no_sanitize_address)) ADDRESS_SANITIZER_WORKAROUND
-#elif __has_attribute (no_address_safety_analysis)
+#elif HAS_ATTRIBUTE (no_address_safety_analysis)
# define ATTRIBUTE_NO_SANITIZE_ADDRESS \
__attribute__ ((no_address_safety_analysis)) ADDRESS_SANITIZER_WORKAROUND
#else
@@ -306,9 +307,9 @@ extern int emacs_setenv_TZ (char const *);
/* Attribute of functions whose undefined behavior should not be sanitized. */
-#if __has_attribute (no_sanitize_undefined)
+#if HAS_ATTRIBUTE (no_sanitize_undefined)
# define ATTRIBUTE_NO_SANITIZE_UNDEFINED __attribute__ ((no_sanitize_undefined))
-#elif __has_attribute (no_sanitize)
+#elif HAS_ATTRIBUTE (no_sanitize)
# define ATTRIBUTE_NO_SANITIZE_UNDEFINED \
__attribute__ ((no_sanitize ("undefined")))
#else