Skip to content
Snippets Groups Projects
Commit cd4b7b53 authored by Simon McVittie's avatar Simon McVittie
Browse files

fdio: Avoid relying on VLAs or gcc-specific constant folding

Formally, `strlen("x")` is not a constant expression, although gcc can
and does optimize it to a constant expression in simple cases.
clang 19.1.6 warns about this usage.

Replace it with the size of a static array (1 more than the strlen of
its contents), which is unambiguously a constant expression.

Resolves: https://gitlab.gnome.org/GNOME/libglnx/-/issues/5


Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 5544bfdd
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment