{nfs,rpc}_set_error: add __attribute__((format(printf))) annotations
[deb_libnfs.git] / include / libnfs-private.h
index 2cc61c3b06a57857d9db6889e7987f40fed0c35b..07ce9a8f96b2b9d3edf355cbbc56cb0a4994cee5 100644 (file)
@@ -28,6 +28,9 @@
 
 #include "libnfs-zdr.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #if !defined(HAVE_SOCKADDR_STORAGE) && !defined(WIN32)
 /*
@@ -130,8 +133,17 @@ int rpc_get_pdu_size(char *buf);
 int rpc_process_pdu(struct rpc_context *rpc, char *buf, int size);
 void rpc_error_all_pdus(struct rpc_context *rpc, char *error);
 
-void rpc_set_error(struct rpc_context *rpc, char *error_string, ...);
-void nfs_set_error(struct nfs_context *nfs, char *error_string, ...);
+void rpc_set_error(struct rpc_context *rpc, char *error_string, ...)
+#ifdef __GNUC__
+ __attribute__((format(printf, 2, 3)))
+#endif
+;
+
+void nfs_set_error(struct nfs_context *nfs, char *error_string, ...)
+#ifdef __GNUC__
+ __attribute__((format(printf, 2, 3)))
+#endif
+;
 
 const char *nfs_get_server(struct nfs_context *nfs);
 const char *nfs_get_export(struct nfs_context *nfs);
@@ -154,4 +166,8 @@ void rpc_free_all_fragments(struct rpc_context *rpc);
 
 const struct nfs_fh3 *nfs_get_rootfh(struct nfs_context *nfs);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* !_LIBNFS_PRIVATE_H_ */