[clang] Diagnose misuse of the cleanup attribute (PR #80040)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 12 05:42:04 PST 2024


https://github.com/AaronBallman commented:

Precommit CI found a valid failure on Windows: 
```
FAIL: Clang :: Sema/attr-cleanup.c (15237 of 19292)
******************** TEST 'Clang :: Sema/attr-cleanup.c' FAILED ********************
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
c:\ws\src\build\build-clang-windows\bin\clang.exe -cc1 -internal-isystem C:\ws\src\build\build-clang-windows\lib\clang\19\include -nostdsysteminc -Wfree-nonheap-object -fsyntax-only -verify C:\ws\src\clang\test\Sema\attr-cleanup.c
# executed command: 'c:\ws\src\build\build-clang-windows\bin\clang.exe' -cc1 -internal-isystem 'C:\ws\src\build\build-clang-windows\lib\clang\19\include' -nostdsysteminc -Wfree-nonheap-object -fsyntax-only -verify 'C:\ws\src\clang\test\Sema\attr-cleanup.c'
# .---command stderr------------
# | error: 'expected-warning' diagnostics seen but not expected:
# |   File C:\ws\src\clang\test\Sema\attr-cleanup.c Line 53: incompatible redeclaration of library function 'malloc'
# | error: 'expected-note' diagnostics seen but not expected:
# |   File C:\ws\src\clang\test\Sema\attr-cleanup.c Line 53: 'malloc' is a builtin with type 'void *(unsigned long long)'
# | 2 errors generated.
# `-----------------------------
# error: command failed with exit status: 1
```
I left a suggestion on how to correct this.

https://github.com/llvm/llvm-project/pull/80040


More information about the cfe-commits mailing list