Re: Question about strings of string_choices.h
From: Kees Cook
Date: Mon Feb 24 2025 - 22:30:31 EST
On Tue, Feb 25, 2025 at 01:43:55AM +0000, Kuninori Morimoto wrote:
>
> Hi Kees, Andy
>
> I would like to use string_choices helper, and want to add well used
> but not yet supported strings. But before that I would like to ask one
> thing about it.
>
> I wonder is it guaranteed that the strings were persist after the
> function returned ? In normally, function local variable will disappear
> when it returns from the function. But I'm not sure in case of
> static inline const, etc.
>
> If it is guaranteed, I'm very happy.
Yes, the compiler puts them in the .rodata section, so they will always
be present.
-Kees
--
Kees Cook