https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125265

--- Comment #1 from Torbjorn SVENSSON <azoff at gcc dot gnu.org> ---
I think it is the same root cause for the 2 failures in
gcc.dg/analyzer/mkostemps-1.c as well.

 111   │ void test_redundant_o_creat (void)
 112   │ {
 113   │   char tmpl[] = "/tmp/dataXXXXXX.db";
 114   │   mkostemps (tmpl, 3, O_CREAT); /* { dg-warning "'mkostemps' flags
argument should not include 'O_RDWR', 'O_CREAT', or 'O_EXCL' as these are
already implied" } */
 115   │ }
 116   │
 117   │ void test_redundant_o_excl (void)
 118   │ {
 119   │   char tmpl[] = "/tmp/dataXXXXXX.db";
 120   │   mkostemps (tmpl, 3, O_EXCL); /* { dg-warning "'mkostemps' flags
argument should not include 'O_RDWR', 'O_CREAT', or 'O_EXCL' as these are
already implied" } */
 121   │ }


Testing analyzer/mkostemps-1.c
doing compile
Executing on host: /build/r17-409-g8376a674e3564f/bin/arm-none-eabi-gcc 
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c  -mthumb
-march=armv6s-m -mtune=cortex-m0 -mfloat-abi=soft -mfpu=auto  
-fdiagnostics-plain-output   -fanalyzer -Wanalyzer-too-complex
-Wanalyzer-symbol-too-complex -Wno-analyzer-null-argument -S     -o
mkostemps-1.s    (timeout = 800)
...
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c: In function
'test_redundant_o_rdwr':
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:108:3: warning:
'mkostemps' flags argument should not include 'O_RDWR', 'O_CREAT', or 'O_EXCL'
as these are already implied [-Wanalyzer-mkostemp-redundant-flags]
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:108:3: note: (1)
'mkostemps' flags argument should not include 'O_RDWR', 'O_CREAT', or 'O_EXCL'
as these are already implied
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:109:1: warning: leak
of file descriptor [CWE-775] [-Wanalyzer-fd-leak]
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:108:3: note: (1)
opened here as read-write
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:108:3: note: (2)
when 'mkostemps' succeeds
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:109:1: note: (3)
leaks here
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c: In function
'test_redundant_o_creat':
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:115:1: warning: leak
of file descriptor [CWE-775] [-Wanalyzer-fd-leak]
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:114:3: note: (1)
opened here as read-write
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:114:3: note: (2)
when 'mkostemps' succeeds
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:115:1: note: (3)
leaks here
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c: In function
'test_redundant_o_excl':
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:121:1: warning: leak
of file descriptor [CWE-775] [-Wanalyzer-fd-leak]
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:120:3: note: (1)
opened here as read-write
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:120:3: note: (2)
when 'mkostemps' succeeds
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:121:1: note: (3)
leaks here
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c: In function
'test_redundant_combined':
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:126:3: warning:
'mkostemps' flags argument should not include 'O_RDWR', 'O_CREAT', or 'O_EXCL'
as these are already implied [-Wanalyzer-mkostemp-redundant-flags]
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:126:3: note: (1)
'mkostemps' flags argument should not include 'O_RDWR', 'O_CREAT', or 'O_EXCL'
as these are already implied
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:127:1: warning: leak
of file descriptor [CWE-775] [-Wanalyzer-fd-leak]
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:126:3: note: (1)
opened here as read-write
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:126:3: note: (2)
when 'mkostemps' succeeds
/build/gcc_src/gcc/testsuite/gcc.dg/analyzer/mkostemps-1.c:127:1: note: (3)
leaks here
...
PASS: gcc.dg/analyzer/mkostemps-1.c  (test for warnings, line 18)
PASS: gcc.dg/analyzer/mkostemps-1.c fix suggestion at line 19 (test for
warnings, line 18)
PASS: gcc.dg/analyzer/mkostemps-1.c  (test for warnings, line 24)
PASS: gcc.dg/analyzer/mkostemps-1.c  (test for warnings, line 29)
PASS: gcc.dg/analyzer/mkostemps-1.c  (test for warnings, line 34)
PASS: gcc.dg/analyzer/mkostemps-1.c  (test for warnings, line 58)
PASS: gcc.dg/analyzer/mkostemps-1.c  (test for warnings, line 65)
PASS: gcc.dg/analyzer/mkostemps-1.c  (test for warnings, line 71)
PASS: gcc.dg/analyzer/mkostemps-1.c  (test for warnings, line 77)
PASS: gcc.dg/analyzer/mkostemps-1.c  (test for warnings, line 83)
PASS: gcc.dg/analyzer/mkostemps-1.c  (test for warnings, line 108)
FAIL: gcc.dg/analyzer/mkostemps-1.c  (test for warnings, line 114)
FAIL: gcc.dg/analyzer/mkostemps-1.c  (test for warnings, line 120)
PASS: gcc.dg/analyzer/mkostemps-1.c  (test for warnings, line 126)
PASS: gcc.dg/analyzer/mkostemps-1.c (test for excess errors)

Reply via email to