[LTP] [PATCH 1/1] m4: Fix warnings

Petr Vorel pvorel@suse.cz
Mon Jan 24 18:18:36 CET 2022


Hi Cyril,

thx for looking into this.

> Hi!
> > diff --git a/m4/ltp-eventfd.m4 b/m4/ltp-eventfd.m4
> > index 5d729a33d..580df00a3 100644
> > --- a/m4/ltp-eventfd.m4
> > +++ b/m4/ltp-eventfd.m4
> > @@ -12,12 +12,10 @@ AC_DEFUN([LTP_CHECK_SYSCALL_EVENTFD], [
> >  		AC_SUBST(AIO_LIBS, "-laio")

> >  		AC_MSG_CHECKING([io_set_eventfd is defined in aio library or aio header])
> > -		AC_TRY_LINK([#include <stdio.h>
> > +		AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
> >                               #include <libaio.h>
> > -		            ],
> > -		            [io_set_eventfd(NULL, 0); return 0;],
> > +		            ]], [[io_set_eventfd(NULL, 0); return 0;]])],
> >  		            [AC_DEFINE(HAVE_IO_SET_EVENTFD, 1, [Define to 1 if you have `io_set_eventfd' function.])
> > -						AC_MSG_RESULT(yes)],
> > -		            [AC_MSG_RESULT(no)])
> > +						AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])

> Shouldn't we convert this bit into AC_CHECK_FUNCS() (in a separte patch)?
Ah, thx for catching this.

> > +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
> > +		#include <linux/perf_event.h>]], [[
> >  			struct perf_event_attr pe;
> > -		],
> > -		AC_DEFINE(HAVE_PERF_EVENT_ATTR) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
> > +		]])],[AC_DEFINE(HAVE_PERF_EVENT_ATTR) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])

> And this one with AC_CHECK_TYPES()?
+1

> > -AC_TRY_LINK([#define _GNU_SOURCE
> > -             #include <math.h>],
> > -            [
> > +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _GNU_SOURCE
> > +             #include <math.h>]], [[
> >               volatile float val;
> >               exp10(val);
> > -            ],
> > -             AC_DEFINE(HAVE_EXP10) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
> > +            ]])],[AC_DEFINE(HAVE_EXP10) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
> >  LIBS="$backup_ldlibs"
> >  ])

> Similarily here AC_CHECK_FUNCS()?
+1

I'll recheck all of AC_LINK_IFELSE, AC_COMPILE_IFELSE before posting next
version.

Kind regards,
Petr


More information about the ltp mailing list