aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/n3.c6
-rw-r--r--src/serd_internal.h7
2 files changed, 11 insertions, 2 deletions
diff --git a/src/n3.c b/src/n3.c
index 0037c829..1a9bfaeb 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -646,10 +646,12 @@ read_IRIREF(SerdReader* reader)
if (c <= 0x20) {
if (isprint(c)) {
r_err(reader, SERD_ERR_BAD_SYNTAX,
- "invalid IRI character `%c' (escape %%%02X)\n", c, c);
+ "invalid IRI character `%c' (escape %%%02X)\n",
+ c, (unsigned)c);
} else {
r_err(reader, SERD_ERR_BAD_SYNTAX,
- "invalid IRI character (escape %%%02X)\n", c, c);
+ "invalid IRI character (escape %%%02X)\n",
+ (unsigned)c);
}
if (reader->strict) {
return pop_node(reader, ref);
diff --git a/src/serd_internal.h b/src/serd_internal.h
index dfb369b3..73c8113b 100644
--- a/src/serd_internal.h
+++ b/src/serd_internal.h
@@ -42,6 +42,12 @@
# define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
+#if defined(__GNUC__)
+# define SERD_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1)))
+#else
+# define SERD_LOG_FUNC(fmt, arg1)
+#endif
+
static const uint8_t replacement_char[] = { 0xEF, 0xBF, 0xBD };
/* File and Buffer Utilities */
@@ -533,6 +539,7 @@ serd_error(SerdErrorSink error_sink, void* handle, const SerdError* e)
}
}
+SERD_LOG_FUNC(3, 4)
int
r_err(SerdReader* reader, SerdStatus st, const char* fmt, ...);