On 2025-04-30 16:37, Joseph Myers wrote:
> On Sat, 26 Apr 2025, Florian Weimer wrote:
>
>> Builtins defined with BT_FN_INT_VAR etc. show as functions without
>> a prototype and trigger the warning.
>>
>> gcc/c/
>>
>> PR c/119950
>> * c-typeck.cc (convert_arguments): Check for built-in
>> function declaration before warning.
>>
>> gcc/testsuite/
>>
>> * gcc.dg/Wdeprecated-non-prototype-5.c: New test.
>
> OK.
>
I keep hitting the bug fixed by this patch with gcc 15.1:
make[3]: Entering directory '/home/simark/build/binutils-gdb-all-targets/sim'
CC bfin/gui.o
In file included from /usr/include/SDL2/SDL_main.h:25,
from /usr/include/SDL2/SDL.h:31,
from /home/simark/src/binutils-gdb/sim/bfin/gui.c:25:
/usr/include/SDL2/SDL_stdinc.h: In function ‘_SDL_size_mul_overflow_builtin’:
/usr/include/SDL2/SDL_stdinc.h:830:12: error: ISO C23 does not allow arguments
for function ‘__builtin_mul_overflow’ declared without parameters
[-Werror=deprecated-non-prototype]
830 | return __builtin_mul_overflow(a, b, ret) == 0 ? 0 : -1;
| ^~~~~~~~~~~~~~~~~~~~~~
Should this patch be cherry-picked into the gcc 15 branch, to be
included in gcc 15.2?
Simon