lib/: Use ATTR_ACCESS() instead of /*@out@*/

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>
This commit is contained in:
Alejandro Colomar
2023-12-11 14:21:24 +01:00
committed by Serge Hallyn
parent 561448443f
commit 76e7de3fbb

View File

@@ -11,8 +11,11 @@
#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 *);
/*