]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
stdio-common: Add nonnull attribute to stdio_ext.h functions.
authorCollin Funk <collin.funk1@gmail.com>
Mon, 19 May 2025 04:32:42 +0000 (21:32 -0700)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 2 Jun 2025 16:32:19 +0000 (13:32 -0300)
* stdio-common/stdio_ext.h (__fbufsize, __freading, __fwriting)
(__freadable, __fwritable, __flbf, __fpurge, __fpending, __fsetlocking):
Add __nonnull ((1)) to these functions since they access the FP without
checking if it is NULL.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
stdio-common/stdio_ext.h

index 3a9a98156e0f27c455ec0cc437ffe40cb2056f1a..397b37f575c6e144ec226220b9d49c969d1a0cb1 100644 (file)
@@ -43,43 +43,43 @@ __BEGIN_DECLS
 
 /* Return the size of the buffer of FP in bytes currently in use by
    the given stream.  */
-extern size_t __fbufsize (FILE *__fp) __THROW;
+extern size_t __fbufsize (FILE *__fp) __THROW __nonnull ((1));
 
 
 /* Return non-zero value iff the stream FP is opened readonly, or if the
    last operation on the stream was a read operation.  */
-extern int __freading (FILE *__fp) __THROW;
+extern int __freading (FILE *__fp) __THROW __nonnull ((1));
 
 /* Return non-zero value iff the stream FP is opened write-only or
    append-only, or if the last operation on the stream was a write
    operation.  */
-extern int __fwriting (FILE *__fp) __THROW;
+extern int __fwriting (FILE *__fp) __THROW __nonnull ((1));
 
 
 /* Return non-zero value iff stream FP is not opened write-only or
    append-only.  */
-extern int __freadable (FILE *__fp) __THROW;
+extern int __freadable (FILE *__fp) __THROW __nonnull ((1));
 
 /* Return non-zero value iff stream FP is not opened read-only.  */
-extern int __fwritable (FILE *__fp) __THROW;
+extern int __fwritable (FILE *__fp) __THROW __nonnull ((1));
 
 
 /* Return non-zero value iff the stream FP is line-buffered.  */
-extern int __flbf (FILE *__fp) __THROW;
+extern int __flbf (FILE *__fp) __THROW __nonnull ((1));
 
 
 /* Discard all pending buffered I/O on the stream FP.  */
-extern void __fpurge (FILE *__fp) __THROW;
+extern void __fpurge (FILE *__fp) __THROW __nonnull ((1));
 
 /* Return amount of output in bytes pending on a stream FP.  */
-extern size_t __fpending (FILE *__fp) __THROW;
+extern size_t __fpending (FILE *__fp) __THROW __nonnull ((1));
 
 /* Flush all line-buffered files.  */
 extern void _flushlbf (void);
 
 
 /* Set locking status of stream FP to TYPE.  */
-extern int __fsetlocking (FILE *__fp, int __type) __THROW;
+extern int __fsetlocking (FILE *__fp, int __type) __THROW __nonnull ((1));
 
 __END_DECLS