]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/: Use ATTR_ACCESS() instead of /*@out@*/
authorAlejandro Colomar <alx@kernel.org>
Mon, 11 Dec 2023 13:21:24 +0000 (14:21 +0100)
committerSerge Hallyn <serge@hallyn.com>
Mon, 15 Jan 2024 19:14:28 +0000 (13:14 -0600)
The compiler seems to ignore the attribute in a function pointer,
though.

Link: <https://splint.org/manual/manual.html#undefined>
Cc: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/commonio.h

index 7ea82d45e954630a1b44e012f581d29c1e02e140..7cd4f2031dd3e75cb2aa0d3ee973e70ec3496fba 100644 (file)
 #ifndef COMMONIO_H
 #define COMMONIO_H
 
+
+#include "attr.h"
 #include "defines.h" /* bool */
 
+
 /*
  * Linked list entry.
  */
@@ -61,7 +64,8 @@ struct commonio_ops {
         * fgets and fputs (can be replaced by versions that
         * understand line continuation conventions).
         */
-       /*@null@*/char *(*fgets) (/*@returned@*/ /*@out@*/char *s, int n, FILE *stream);
+       ATTR_ACCESS(write_only, 1, 2)
+       /*@null@*/char *(*fgets)(/*@returned@*/char *s, int n, FILE *stream);
        int (*fputs) (const char *, FILE *);
 
        /*