Skip to content

Commit

Permalink
Swap alloc_size parameters (GCC 14.1 bug)
Browse files Browse the repository at this point in the history
Starting in GCC 14, alloc_size uses calloc semantics and emits a warning
if the first parameter is a sizeof result. This behavior is undocumented
and breaks with the previous commutative behavior.
  • Loading branch information
skeeto committed May 7, 2024
1 parent 8bf7541 commit 7508174
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion u-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static b32 pathsep(u8 c)
return c=='/' || c=='\\';
}

__attribute((malloc, alloc_size(2, 3)))
__attribute((malloc, alloc_size(3, 2)))
static byte *alloc(arena *a, size objsize, size count)
{
assert(objsize > 0);
Expand Down

0 comments on commit 7508174

Please sign in to comment.