Re: [PATCH testsuite] tests/file_contexts: avoid using a C99-style for loop

Stephen Smalley <[email protected]> Tue, 28 Jul 2026 15:49:45 -0400
Newsgroups org.kernel.vger.selinux
Message-ID <CAEjxPJ7qT1Q43tEntjSXrJVzbEjmFVqGfX_fC6Nz9_Cks7TVbQ@mail.gmail.com>
On Mon, Jul 27, 2026 at 9:33 AM Stephen Smalley
<[email protected]> wrote:
>
> On Mon, Jul 27, 2026 at 7:54 AM Ondrej Mosnacek <[email protected]> wrote:
> >
> > The for loop in assertContextsMatch() seems to be the only code that
> > makes use of C99 features, which means that it fails to build with older
> > compilers, such as GCC on RHEL-7. Avoid this by moving the declaration
> > out of the for loop.
> >
> > An alternative would be to instead add -std=c99 to CFLAGS, but it seems
> > simpler to just revert to the C90 status quo ante.
> >
> > Signed-off-by: Ondrej Mosnacek <[email protected]>
>
> It makes me sad that there are still people using RHEL-7 but:
> Acked-by: Stephen Smalley <[email protected]>

Thanks, merged.