Message ID | 1410903170-31206-2-git-send-email-will.newton@linaro.org |
---|---|
State | Committed |
Headers |
Received: (qmail 367 invoked by alias); 16 Sep 2014 21:33:04 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 32655 invoked by uid 89); 16 Sep 2014 21:33:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f48.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=7f8AY1uf6q/5Gqm0pwFDrcoteDN+uic/enwELs6oPvo=; b=dAOOMNQfpFwMvttiDaMQ4BlWNuxin7B53oVLJgq+SrvhRNidrYRk2drmOwIa70eBDh AGqd0YS05hlwaLnveLWEfgj0xgIYDHwxUMQ0wrTA2FFtNo5PwMv66cm+jVDHnpIVN2oK xjUk+6NjxZZ3H58AA0W/QnZUv3QIywhNCwMUdQiznrU8t1qFJWpsrcBjblexMvFpM6PT A6NytSEwuWoEARY1pHkBSotRIdpEbcjETBaZkyUhn7DteG2YcN521sKGEqflaL62eBBH 0gzsgijy3TAPeU0/NmJP8tUYqcG2fEOnryIfkladZz9QZkYbtYlleLlwAQbYZElJ08oc DwXA== X-Gm-Message-State: ALoCoQlNJ2vwf3YXIbqjy5Rh+Z+wtLjuhZzw+AS3d/2LwByisloTrvjlKShk/kPo7/2OlWroZdrJ X-Received: by 10.70.94.201 with SMTP id de9mr33791725pdb.103.1410903180270; Tue, 16 Sep 2014 14:33:00 -0700 (PDT) From: Will Newton <will.newton@linaro.org> To: libc-alpha@sourceware.org Subject: [PATCH] stdlib/tst-strtod-round.c: Fix build on ARM Date: Tue, 16 Sep 2014 14:32:50 -0700 Message-Id: <1410903170-31206-2-git-send-email-will.newton@linaro.org> In-Reply-To: <1410903170-31206-1-git-send-email-will.newton@linaro.org> References: <1410903170-31206-1-git-send-email-will.newton@linaro.org> |
Commit Message
Will Newton
Sept. 16, 2014, 9:32 p.m. UTC
Building this test on ARM fails because the prototypes for the long double variants of the math functions are unavailable. Add an additional include guard to math.h that enables long double math function declarations if _LIBC_TEST is defined and define _LIBC_TEST in stdlib/tst-strtod-round.c. ChangeLog: 2014-09-16 Will Newton <will.newton@linaro.org> * math/math.h: Define long double math functions if _LIBC_TEST is defined. * stdlib/tst-strtod-round.c: Define _LIBC_TEST. --- math/math.h | 2 +- stdlib/tst-strtod-round.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)
Comments
On 16 September 2014 14:32, Will Newton <will.newton@linaro.org> wrote: > Building this test on ARM fails because the prototypes for the long > double variants of the math functions are unavailable. > > Add an additional include guard to math.h that enables long double math > function declarations if _LIBC_TEST is defined and define _LIBC_TEST in > stdlib/tst-strtod-round.c. > > ChangeLog: > > 2014-09-16 Will Newton <will.newton@linaro.org> > > * math/math.h: Define long double math functions if > _LIBC_TEST is defined. > * stdlib/tst-strtod-round.c: Define _LIBC_TEST. > --- > math/math.h | 2 +- > stdlib/tst-strtod-round.c | 3 +++ > 2 files changed, 4 insertions(+), 1 deletion(-) Ping? > diff --git a/math/math.h b/math/math.h > index 72ec2ca..dc7ab2d 100644 > --- a/math/math.h > +++ b/math/math.h > @@ -91,7 +91,7 @@ __BEGIN_DECLS > # undef _Mdouble_END_NAMESPACE > # undef __MATH_PRECNAME > > -# if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) \ > +# if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC && !defined _LIBC_TEST) \ > || defined __LDBL_COMPAT > # ifdef __LDBL_COMPAT > > diff --git a/stdlib/tst-strtod-round.c b/stdlib/tst-strtod-round.c > index f334b20..cbde457 100644 > --- a/stdlib/tst-strtod-round.c > +++ b/stdlib/tst-strtod-round.c > @@ -17,6 +17,9 @@ > License along with the GNU C Library; if not, see > <http://www.gnu.org/licenses/>. */ > > +/* Defining _LIBC_TEST ensures long double math functions are > + declared in the headers. */ > +#define _LIBC_TEST 1 > #include <fenv.h> > #include <float.h> > #include <math.h> > -- > 1.9.3 >
On Tue, Sep 16, 2014 at 02:32:50PM -0700, Will Newton wrote: > Building this test on ARM fails because the prototypes for the long > double variants of the math functions are unavailable. > > Add an additional include guard to math.h that enables long double math > function declarations if _LIBC_TEST is defined and define _LIBC_TEST in > stdlib/tst-strtod-round.c. > > ChangeLog: > > 2014-09-16 Will Newton <will.newton@linaro.org> > > * math/math.h: Define long double math functions if > _LIBC_TEST is defined. > * stdlib/tst-strtod-round.c: Define _LIBC_TEST. > --- > math/math.h | 2 +- > stdlib/tst-strtod-round.c | 3 +++ > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/math/math.h b/math/math.h > index 72ec2ca..dc7ab2d 100644 > --- a/math/math.h > +++ b/math/math.h > @@ -91,7 +91,7 @@ __BEGIN_DECLS > # undef _Mdouble_END_NAMESPACE > # undef __MATH_PRECNAME > > -# if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) \ > +# if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC && !defined _LIBC_TEST) \ Wouldn't it be nicer to read with: # if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) || defined _LIBC_TEST || defined __LDBL_COMPAT ... The double negation looks a bit ugly to me. Looks OK otherwise. Siddhesh
On Wed, Sep 24, 2014 at 08:29:15PM +0530, Siddhesh Poyarekar wrote: > On Tue, Sep 16, 2014 at 02:32:50PM -0700, Will Newton wrote: > > Building this test on ARM fails because the prototypes for the long > > double variants of the math functions are unavailable. > > > > Add an additional include guard to math.h that enables long double math > > function declarations if _LIBC_TEST is defined and define _LIBC_TEST in > > stdlib/tst-strtod-round.c. > > > > ChangeLog: > > > > 2014-09-16 Will Newton <will.newton@linaro.org> > > > > * math/math.h: Define long double math functions if > > _LIBC_TEST is defined. > > * stdlib/tst-strtod-round.c: Define _LIBC_TEST. Oh, and this needs a BZ. Siddhesh
On Wed, 24 Sep 2014, Siddhesh Poyarekar wrote: > On Wed, Sep 24, 2014 at 08:29:15PM +0530, Siddhesh Poyarekar wrote: > > On Tue, Sep 16, 2014 at 02:32:50PM -0700, Will Newton wrote: > > > Building this test on ARM fails because the prototypes for the long > > > double variants of the math functions are unavailable. > > > > > > Add an additional include guard to math.h that enables long double math > > > function declarations if _LIBC_TEST is defined and define _LIBC_TEST in > > > stdlib/tst-strtod-round.c. > > > > > > ChangeLog: > > > > > > 2014-09-16 Will Newton <will.newton@linaro.org> > > > > > > * math/math.h: Define long double math functions if > > > _LIBC_TEST is defined. > > > * stdlib/tst-strtod-round.c: Define _LIBC_TEST. > > Oh, and this needs a BZ. I don't see why - it's not a bug that was user-visible in a release. User programs, which should never define _LIBC or _LIBC_TEST, will have got the required declarations anyway.
On Wed, Sep 24, 2014 at 03:13:17PM +0000, Joseph S. Myers wrote: > I don't see why - it's not a bug that was user-visible in a release. > User programs, which should never define _LIBC or _LIBC_TEST, will have > got the required declarations anyway. There's a build component in bugzilla that exists for exactly such bugs. It could be argued that it's a test failure and not a build failure, but then most distributions (and people) have the test run as part of their workflow and a test failure may in some cases result in a build failure. Siddhesh
On Wed, 24 Sep 2014, Siddhesh Poyarekar wrote: > On Wed, Sep 24, 2014 at 03:13:17PM +0000, Joseph S. Myers wrote: > > I don't see why - it's not a bug that was user-visible in a release. > > User programs, which should never define _LIBC or _LIBC_TEST, will have > > got the required declarations anyway. > > There's a build component in bugzilla that exists for exactly such > bugs. It could be argued that it's a test failure and not a build > failure, but then most distributions (and people) have the test run as > part of their workflow and a test failure may in some cases result in > a build failure. But it's not a test failure in a release either (and the point of filing a bug when fixing it is for users of releases to be able to find fixed bugs when searching Bugzilla; anyone using git master should be following libc-alpha). It's build warnings (the functions get the right types anyway, being built-in). The use of -Werror=implicit-function-declaration postdates the last release.
On 24 September 2014 20:58, Joseph S. Myers <joseph@codesourcery.com> wrote: > But it's not a test failure in a release either (and the point of filing a > bug when fixing it is for users of releases to be able to find fixed bugs > when searching Bugzilla; anyone using git master should be following > libc-alpha). It's build warnings (the functions get the right types > anyway, being built-in). The use of -Werror=implicit-function-declaration > postdates the last release. Ah, of course. Never mind then. Thanks, Siddhesh
diff --git a/math/math.h b/math/math.h index 72ec2ca..dc7ab2d 100644 --- a/math/math.h +++ b/math/math.h @@ -91,7 +91,7 @@ __BEGIN_DECLS # undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME -# if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) \ +# if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC && !defined _LIBC_TEST) \ || defined __LDBL_COMPAT # ifdef __LDBL_COMPAT diff --git a/stdlib/tst-strtod-round.c b/stdlib/tst-strtod-round.c index f334b20..cbde457 100644 --- a/stdlib/tst-strtod-round.c +++ b/stdlib/tst-strtod-round.c @@ -17,6 +17,9 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +/* Defining _LIBC_TEST ensures long double math functions are + declared in the headers. */ +#define _LIBC_TEST 1 #include <fenv.h> #include <float.h> #include <math.h>