Messages in this thread | | | Date | Wed, 2 Feb 2022 18:16:28 +0200 | From | Andy Shevchenko <> | Subject | Re: [PATCH] lib/test_string.c: Add test for strlen() |
| |
On Wed, Feb 02, 2022 at 08:01:49AM -0800, Guenter Roeck wrote: > On Sun, Jan 30, 2022 at 10:36:53AM -0800, Kees Cook wrote:
...
> > +static const int strlen_ce = strlen("tada, a constant expression"); > > This results in: > > lib/test_string.c:188:30: error: initializer element is not constant > 188 | static const int strlen_ce = strlen("tada, a constant expression"); > > for several of my tests. I don't think you can mandate that a compiler > implements this.
With -O2 probably one can, otherwise I agree.
-- With Best Regards, Andy Shevchenko
| |