[Bug target/108722] gcc.dg/analyzer/file-CWE-1341-example.c fails on power 9 BE

2023-04-11 Thread guojiufu at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108722

Jiu Fu Guo  changed:

   What|Removed |Added

 CC||guojiufu at gcc dot gnu.org

--- Comment #1 from Jiu Fu Guo  ---
The case only checkes [CWE-1341] which is `double-fclose`.
While on the BE machine, besides [CWE-1341], a message of [CWE-415] is also
reported. Because attribute `malloc` is attached on fopen:
```
# 258 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename,
  const char *__restrict __modes)   
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1))) ;

or say: __attribute_malloc__ __attr_dealloc_fclose __wur;
```

Because this case is not intended to test CWE-415, it may be ok to add
-Wno-analyzer-double-free for this case.

[Bug target/108722] gcc.dg/analyzer/file-CWE-1341-example.c fails on power 9 BE

2023-04-02 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108722

John David Anglin  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
 Target|powerpc64-linux-gnu |powerpc64-linux-gnu
   ||hppa-linux-gnu
   Last reconfirmed||2023-04-02
   Host|powerpc64-linux-gnu |powerpc64-linux-gnu
   ||hppa-linux-gnu
 CC||danglin at gcc dot gnu.org
  Build|powerpc64-linux-gnu |powerpc64-linux-gnu
   ||hppa-linux-gnu