about summary refs log tree commit diff
path: root/libio/tst-fopenloc.c
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-04-21 14:21:33 +0800
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-05-16 06:56:32 -0300
commit71d9e0fe766a3c22a730995b9d024960970670af (patch)
treebbf0973cd973a5195a1126aa46f9ea800309f4a9 /libio/tst-fopenloc.c
parentbea1a4a77305cef90dac47b873bd9f01a6409c22 (diff)
downloadglibc-71d9e0fe766a3c22a730995b9d024960970670af.tar.gz
glibc-71d9e0fe766a3c22a730995b9d024960970670af.tar.xz
glibc-71d9e0fe766a3c22a730995b9d024960970670af.zip
libio: Add __nonnull for FILE * arguments of fclose and freopen
Calling fclose or freopen with a null FILE * is undefined behavior, and
doing so in practice will cause a SIGSEGV.  So it seems suitable for
__nonnull.

This will help the compiler to warn for some buggy code, like
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109570.
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'libio/tst-fopenloc.c')
0 files changed, 0 insertions, 0 deletions