aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-06-11 00:17:46 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-06-11 00:17:46 +0200
commitb105dee61824f2848b2f199943b7689ece2158b9 (patch)
treec525968107247746144799f33899d997daeacde1 /src
parent01a1e41bbb650d0d31512d0cd3a04225c5493d77 (diff)
Color functions with __attribute__()
Diffstat (limited to 'src')
-rw-r--r--src/errors.h2
-rw-r--r--src/unicode.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/errors.h b/src/errors.h
index c3ccaf2..eebd607 100644
--- a/src/errors.h
+++ b/src/errors.h
@@ -3,6 +3,6 @@
#include <stdnoreturn.h>
-noreturn void err(const char *, ...);
+noreturn void err(const char *, ...) __attribute__((format(printf, 1, 2)));
#endif /* !ORYX_ERRORS_H */
diff --git a/src/unicode.h b/src/unicode.h
index 8b18d45..36bbc81 100644
--- a/src/unicode.h
+++ b/src/unicode.h
@@ -9,14 +9,14 @@
typedef uint32_t rune;
/* Assert that CH has the Unicode Pattern_White_Space property */
-bool rune_is_pat_ws(rune ch);
+bool rune_is_pat_ws(rune ch) __attribute__((const));
/* Assert that CH has the Unicode XID_Start or XID_Continue property. The
rune_is_xids() function extends XID_Start to include U+005F LOW LINE, and the
rune_is_xidc() function extends XID_Continue to include U+2032 PRIME,
U+2033 DOUBLE PRIME, U+2034 TRIPLE PRIME, and U+2057 QUADRUPLE PRIME. */
-bool rune_is_xids(rune ch);
-bool rune_is_xidc(rune ch);
+bool rune_is_xids(rune ch) __attribute__((const));
+bool rune_is_xidc(rune ch) __attribute__((const));
/* Decode the first UTF-8 rune in S, and point S to the next rune in the stream.
This function assumes that S points to a buffer that’s padded to a length of