From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Kees Cook <keescook@chromium.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Peter Rosin <peda@axentia.se>, Andy Shevchenko <andy@kernel.org>,
Matteo Croce <mcroce@microsoft.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH] lib/test_string.c: Add test for strlen()
Date: Wed, 2 Feb 2022 18:16:28 +0200 [thread overview]
Message-ID: <YfquXPrMX6PdD/6u@smile.fi.intel.com> (raw)
In-Reply-To: <20220202160149.GA2322037@roeck-us.net>
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
next prev parent reply other threads:[~2022-02-02 16:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-30 18:36 [PATCH] lib/test_string.c: Add test for strlen() Kees Cook
2022-01-30 18:56 ` Andy Shevchenko
2022-01-30 20:34 ` Kees Cook
2022-01-30 20:13 ` kernel test robot
2022-01-30 20:35 ` Kees Cook
2022-02-02 16:01 ` Guenter Roeck
2022-02-02 16:16 ` Andy Shevchenko [this message]
2022-02-02 20:52 ` Kees Cook
2022-02-02 23:12 ` Guenter Roeck
2022-02-03 8:04 ` Geert Uytterhoeven
2022-02-03 16:41 ` Kees Cook
2022-02-03 17:15 ` Kees Cook
2022-02-03 18:09 ` Geert Uytterhoeven
2022-02-03 19:50 ` Nick Desaulniers
2022-02-03 20:25 ` Kees Cook
2022-02-03 20:45 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YfquXPrMX6PdD/6u@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=geert@linux-m68k.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=llvm@lists.linux.dev \
--cc=mcroce@microsoft.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=peda@axentia.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox