From 76e7de3fbb978f9c153eb422cd106a786cbc9d79 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Mon, 11 Dec 2023 14:21:24 +0100 Subject: [PATCH] lib/: Use ATTR_ACCESS() instead of /*@out@*/ The compiler seems to ignore the attribute in a function pointer, though. Link: Cc: Serge Hallyn Signed-off-by: Alejandro Colomar --- lib/commonio.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/commonio.h b/lib/commonio.h index 7ea82d45e..7cd4f2031 100644 --- a/lib/commonio.h +++ b/lib/commonio.h @@ -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 *); /* -- 2.47.2