]> diplodocus.org Git - nmh/commitdiff
Add ENDNULL macro for gcc's `sentinel' function attribute.
authorRalph Corderoy <ralph@inputplus.co.uk>
Mon, 28 Aug 2017 18:47:23 +0000 (19:47 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Mon, 28 Aug 2017 19:00:51 +0000 (20:00 +0100)
Annotate a few prototypes with it.

h/mh.h
h/prototypes.h
sbr/oauth.c

diff --git a/h/mh.h b/h/mh.h
index bb06366..2723a42 100644 (file)
--- a/h/mh.h
+++ b/h/mh.h
@@ -47,6 +47,7 @@ typedef unsigned char  boolean;  /* not int so we can pack in a structure */
 #define MALLOC __attribute__((malloc))
 #define NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
 #define PURE __attribute__((pure))
+#define ENDNULL __attribute__((sentinel))
 #define NMH_UNUSED(i) (void) i
 #else
 #define NORETURN
@@ -56,6 +57,7 @@ typedef unsigned char  boolean;  /* not int so we can pack in a structure */
 #define MALLOC
 #define NONNULL(...)
 #define PURE
+#define ENDNULL
 #define NMH_UNUSED(i) i
 #endif
 
index ab9e83d..0c2d7bd 100644 (file)
@@ -44,7 +44,7 @@ char **brkstring (char *, char *, char *) NONNULL(1);
 int check_charset (char *, int);
 int client(char *, char *, char *, int, int);
 void closefds(int);
-char *concat (const char *, ...);
+char *concat (const char *, ...) ENDNULL;
 int context_del (char *);
 char *context_find (const char *) PURE;
 char *context_find_by_type (const char *, const char *, const char *);
index 8e3d6b0..3a8d291 100755 (executable)
@@ -125,8 +125,8 @@ struct curl_ctx {
     char res_body[RESPONSE_BODY_MAX];
 };
 
-static boolean get_json_strings(const char *, size_t, FILE *, ...);
-static boolean make_query_url(char *, size_t, CURL *, const char *, ...);
+static boolean get_json_strings(const char *, size_t, FILE *, ...) ENDNULL;
+static boolean make_query_url(char *, size_t, CURL *, const char *, ...) ENDNULL;
 static boolean post(struct curl_ctx *, const char *, const char *);
 
 int