summaryrefslogtreecommitdiff
path: root/ChangeLog
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-04-24 12:06:55 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2023-04-24 12:07:40 -0700
commit4bb14d69493fd3bbc328b86755420892a88d3fd8 (patch)
treefc09f7a7eefc2cc077dc4b9bb4ce77961da52669 /ChangeLog
parentb98993a1baaa2fc39b301676ecbd8bb29e1d9c96 (diff)
downloadgnulib-4bb14d69493fd3bbc328b86755420892a88d3fd8.tar.gz
fclose: pacify gcc -Wanalyzer-file-leak
Without this patch, building coreutils with --enable-gcc-checking=expensive would fail with a message like “lib/exclude.c:682:6: error: leak of FILE 'in' [CWE-775] [-Werror=analyzer-file-leak]”, because Gnulib replaced fclose but not fopen, and GCC saw a call to fopen followed by a call to rpl_fclose. The patch causes GCC to instead see a call to rpl_fopen followed by rpl_fclose. * m4/fclose.m4 (gl_FUNC_FCLOSE): Replace fopen when replacing fclose. * modules/fclose (Depends-on): Add fopen. (configure.ac): Replace fopen when replacing fclose.
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog13
1 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 972aec03db..8d39a64023 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2023-04-24 Paul Eggert <eggert@cs.ucla.edu>
+ fclose: pacify gcc -Wanalyzer-file-leak
+ Without this patch, building coreutils with
+ --enable-gcc-checking=expensive would fail with a message like
+ “lib/exclude.c:682:6: error: leak of FILE 'in' [CWE-775]
+ [-Werror=analyzer-file-leak]”, because Gnulib replaced fclose but
+ not fopen, and GCC saw a call to fopen followed by a call to
+ rpl_fclose. The patch causes GCC to instead see a call to
+ rpl_fopen followed by rpl_fclose.
+ * m4/fclose.m4 (gl_FUNC_FCLOSE): Replace fopen when replacing
+ fclose.
+ * modules/fclose (Depends-on): Add fopen.
+ (configure.ac): Replace fopen when replacing fclose.
+
unsetenv-tests: pacify -Wanalyzer-putenv-of-auto-var
* tests/test-unsetenv.c (main): Make entry static. Even with this
change, it’s unclear whether this test is portable POSIX code, but