diff options
| author | Qing Zhao <qing.zhao@oracle.com> | 2026-01-26 20:22:43 +0000 |
|---|---|---|
| committer | Qing Zhao <qing.zhao@oracle.com> | 2026-01-27 20:46:04 +0000 |
| commit | 078b0a2be260ccb2c118865058e75ae038fc1949 (patch) | |
| tree | 9eed9fe0da56c941cef2ba648098b93cadf71a7d /libphobos/src/std/regex | |
| parent | a321508c1b91bc9ef5f6029379e579fcdc10cb70 (diff) | |
| download | gcc-master.zip gcc-master.tar.gz gcc-master.tar.bz2 | |
C: Do not warn for calls to .ACCESS_WITH_SIZE when -Wbad-function-cast is specified [PR123500]HEADtrunkmaster
For the following source code:
(uintptr_t)b->ptr;
when b->ptr has an counted_by annotation, the IR for this pointer reference
is changed to a call to .ACCESS_WITH_SIZE as:
(uintptr_t).ACCESS_WITH_SIZE (b->ptr, &b->len, 0B, 1);
As a result, the following code in the routine "build_c_cast" is invoked:
7455 if (TREE_CODE (value) == CALL_EXPR
7456 && TREE_CODE (type) != TREE_CODE (otype))
7457 warning_at (loc, OPT_Wbad_function_cast,
7458 "cast from function call of type %qT "
7459 "to non-matching type %qT", otype, type);
7460
It's obviously that C FE should exclude the call to .ACCESS_WITH_SIZE from
issuing such warning.
PR c/123500
gcc/c/ChangeLog:
* c-typeck.cc (build_c_cast): Exclude call to .ACCESS_WITH_SIZE from
-Wbad-function-cast warnings.
gcc/testsuite/ChangeLog:
* gcc.dg/pointer-counted-by-pr123500.c: New test.
Diffstat (limited to 'libphobos/src/std/regex')
0 files changed, 0 insertions, 0 deletions
