[LTP] [PATCH 1/2] stack_clash: Guard functions used only in 64bit

Petr Vorel pvorel@suse.cz
Thu Oct 26 01:14:48 CEST 2023


Hi Cyril,

> Hi!
> > To avoid "defined but not used" warnings when compiled on 32bit.

> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> >  testcases/cve/stack_clash.c | 4 ++++
> >  1 file changed, 4 insertions(+)

> > diff --git a/testcases/cve/stack_clash.c b/testcases/cve/stack_clash.c
Hi Cyril,

> > +#ifdef __x86_64__
> >  static void force_bottom_up(void)
> >  {
> >  	FILE *fh;
> > @@ -134,6 +135,7 @@ static void force_bottom_up(void)
> >  out:
> >  	SAFE_FCLOSE(fh);
> >  }
> > +#endif

> Maybe I'm blind but this function does not seem to be called from inside
> of #ifdef __x86_64__.

force_bottom_up() is called only inside do_mmap_placement_test(), which is also
wrapped with #ifdef __x86_64_.

I did not notice that, compiler pointed it out :).

Can I merge with your RBT?

Kind regards,
Petr


More information about the ltp mailing list