Re: [Piglit] [PATCH 2/3] tests: Use FE_UPWARD only if its defined in fenv.h
Okay, revised patch submitted, which hopefully does the right thing this time. Ross On Fri, 30 Nov 2018 at 15:54, Burton, Ross wrote: > > Erm, yeah, sorry about that. Grabbing a patch that we've been > shipping without actually looking at it. > > Ross > On Fri, 30 Nov 2018 at 12:37, Eric Engestrom wrote: > > > > On Friday, 2018-11-30 10:45:05 +, Ross Burton wrote: > > > From: Khem Raj > > > > > > On ARM, musl does not define FE_* when arch does not have > > > VFP, (which is right interpretation), therefore check if > > > it is defined before using it. > > > > > > Fixes errors like: > > > > > > tests/general/roundmode-pixelstore.c:82:19: error: 'FE_UPWARD' undeclared > > > (first use in this function) > > > ret = fesetround(FE_UPWARD); > > >^ > > > > > > Signed-off-by: Khem Raj > > > --- > > > tests/general/roundmode-getintegerv.c | 2 ++ > > > tests/general/roundmode-pixelstore.c | 2 ++ > > > 2 files changed, 4 insertions(+) > > > > > > diff --git a/tests/general/roundmode-getintegerv.c > > > b/tests/general/roundmode-getintegerv.c > > > index 28ecfaf55..5c275797b 100644 > > > --- a/tests/general/roundmode-getintegerv.c > > > +++ b/tests/general/roundmode-getintegerv.c > > > @@ -81,7 +81,9 @@ piglit_init(int argc, char **argv) > > > { > > > int ret; > > > bool pass = true; > > > +#ifdef FE_UPWARD > > > ret = fesetround(FE_UPWARD); > > > +#endif > > > if (ret != 0) { > > > > You'll need a #else that sets ret, otherwise you're pretty obviously > > going to jump based on an uninitialised variable here :/ > > > > > printf("Couldn't set rounding mode\n"); > > > piglit_report_result(PIGLIT_SKIP); > > > diff --git a/tests/general/roundmode-pixelstore.c > > > b/tests/general/roundmode-pixelstore.c > > > index 8a029b257..51951a0d9 100644 > > > --- a/tests/general/roundmode-pixelstore.c > > > +++ b/tests/general/roundmode-pixelstore.c > > > @@ -81,7 +81,9 @@ piglit_init(int argc, char **argv) > > > { > > > int ret; > > > bool pass = true; > > > +#ifdef FE_UPWARD > > > ret = fesetround(FE_UPWARD); > > > +#endif > > > if (ret != 0) { > > > printf("Couldn't set rounding mode\n"); > > > piglit_report_result(PIGLIT_SKIP); > > > -- > > > 2.11.0 > > > > > > ___ > > > Piglit mailing list > > > Piglit@lists.freedesktop.org > > > https://lists.freedesktop.org/mailman/listinfo/piglit ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 2/3] tests: Use FE_UPWARD only if its defined in fenv.h
Erm, yeah, sorry about that. Grabbing a patch that we've been shipping without actually looking at it. Ross On Fri, 30 Nov 2018 at 12:37, Eric Engestrom wrote: > > On Friday, 2018-11-30 10:45:05 +, Ross Burton wrote: > > From: Khem Raj > > > > On ARM, musl does not define FE_* when arch does not have > > VFP, (which is right interpretation), therefore check if > > it is defined before using it. > > > > Fixes errors like: > > > > tests/general/roundmode-pixelstore.c:82:19: error: 'FE_UPWARD' undeclared > > (first use in this function) > > ret = fesetround(FE_UPWARD); > >^ > > > > Signed-off-by: Khem Raj > > --- > > tests/general/roundmode-getintegerv.c | 2 ++ > > tests/general/roundmode-pixelstore.c | 2 ++ > > 2 files changed, 4 insertions(+) > > > > diff --git a/tests/general/roundmode-getintegerv.c > > b/tests/general/roundmode-getintegerv.c > > index 28ecfaf55..5c275797b 100644 > > --- a/tests/general/roundmode-getintegerv.c > > +++ b/tests/general/roundmode-getintegerv.c > > @@ -81,7 +81,9 @@ piglit_init(int argc, char **argv) > > { > > int ret; > > bool pass = true; > > +#ifdef FE_UPWARD > > ret = fesetround(FE_UPWARD); > > +#endif > > if (ret != 0) { > > You'll need a #else that sets ret, otherwise you're pretty obviously > going to jump based on an uninitialised variable here :/ > > > printf("Couldn't set rounding mode\n"); > > piglit_report_result(PIGLIT_SKIP); > > diff --git a/tests/general/roundmode-pixelstore.c > > b/tests/general/roundmode-pixelstore.c > > index 8a029b257..51951a0d9 100644 > > --- a/tests/general/roundmode-pixelstore.c > > +++ b/tests/general/roundmode-pixelstore.c > > @@ -81,7 +81,9 @@ piglit_init(int argc, char **argv) > > { > > int ret; > > bool pass = true; > > +#ifdef FE_UPWARD > > ret = fesetround(FE_UPWARD); > > +#endif > > if (ret != 0) { > > printf("Couldn't set rounding mode\n"); > > piglit_report_result(PIGLIT_SKIP); > > -- > > 2.11.0 > > > > ___ > > Piglit mailing list > > Piglit@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/piglit ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 2/3] tests: Use FE_UPWARD only if its defined in fenv.h
On Friday, 2018-11-30 10:45:05 +, Ross Burton wrote: > From: Khem Raj > > On ARM, musl does not define FE_* when arch does not have > VFP, (which is right interpretation), therefore check if > it is defined before using it. > > Fixes errors like: > > tests/general/roundmode-pixelstore.c:82:19: error: 'FE_UPWARD' undeclared > (first use in this function) > ret = fesetround(FE_UPWARD); >^ > > Signed-off-by: Khem Raj > --- > tests/general/roundmode-getintegerv.c | 2 ++ > tests/general/roundmode-pixelstore.c | 2 ++ > 2 files changed, 4 insertions(+) > > diff --git a/tests/general/roundmode-getintegerv.c > b/tests/general/roundmode-getintegerv.c > index 28ecfaf55..5c275797b 100644 > --- a/tests/general/roundmode-getintegerv.c > +++ b/tests/general/roundmode-getintegerv.c > @@ -81,7 +81,9 @@ piglit_init(int argc, char **argv) > { > int ret; > bool pass = true; > +#ifdef FE_UPWARD > ret = fesetround(FE_UPWARD); > +#endif > if (ret != 0) { You'll need a #else that sets ret, otherwise you're pretty obviously going to jump based on an uninitialised variable here :/ > printf("Couldn't set rounding mode\n"); > piglit_report_result(PIGLIT_SKIP); > diff --git a/tests/general/roundmode-pixelstore.c > b/tests/general/roundmode-pixelstore.c > index 8a029b257..51951a0d9 100644 > --- a/tests/general/roundmode-pixelstore.c > +++ b/tests/general/roundmode-pixelstore.c > @@ -81,7 +81,9 @@ piglit_init(int argc, char **argv) > { > int ret; > bool pass = true; > +#ifdef FE_UPWARD > ret = fesetround(FE_UPWARD); > +#endif > if (ret != 0) { > printf("Couldn't set rounding mode\n"); > piglit_report_result(PIGLIT_SKIP); > -- > 2.11.0 > > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/piglit ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit