[PATCH v3] psxtests: Fix math function build warnings

Stephen Clark stephen.clark at oarcorp.com
Fri Mar 19 17:21:30 UTC 2021


I must have misunderstood your email about using the file header block from https://docs.rtems.org/branches/master/eng/coding-file-hdr.html. Which header were you recommending that I add?

-----Original Message-----
From: Gedare Bloom <gedare at rtems.org> 
Sent: Friday, March 19, 2021 12:02 PM
To: Stephen Clark <stephen.clark at oarcorp.com>
Cc: devel at rtems.org
Subject: Re: [PATCH v3] psxtests: Fix math function build warnings

> diff --git a/testsuites/psxtests/psxhdrs/math/has_long_double.h 
> b/testsuites/psxtests/psxhdrs/math/has_long_double.h
> new file mode 100644
> index 0000000000..4372142288
> --- /dev/null
> +++ b/testsuites/psxtests/psxhdrs/math/has_long_double.h
> @@ -0,0 +1,53 @@
> +/* SPDX-License-Identifier: BSD-2-Clause */
> +
> +/**
> + * @file
> + *
> + * @brief Defines NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
> + *
> + * This file uses logic copied from newlib's math.h on 21 Jan 2021
> + * to determine whether or not the long double math functions tests
> + * should be built. The original math.h file was sourced from
> + * 
> +https://codeload.github.com/RTEMS/sourceware-mirror-newlib-cygwin/tar
> +.gz/a0d7982
> + */
> +
> +/*
> + * Copyright (C) 2021, 2021 Stephen Clark
> + *

I don't think that the copied portion has been modified substantially that (a) allows to apply a different license than was used in the upstream, and (b) allows to add a copyright here.

> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *    notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *    notice, this list of conditions and the following disclaimer in the
> + *    documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
> + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 
> + TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
> + PURPOSE
> + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
> + CONTRIBUTORS BE
> + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 
> + OR
> + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
> + OF
> + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
> + BUSINESS
> + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
> + WHETHER IN
> + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
> + OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
> + ADVISED OF THE
> + * POSSIBILITY OF SUCH DAMAGE.
> + */
> +
> +#ifndef HAS_LONG_DOUBLE_H
> +#define HAS_LONG_DOUBLE_H
> +
> +/* Newlib doesn't fully support long double math functions so far.
> +   On platforms where long double equals double the long double functions
> +   simply call the double functions.  On Cygwin the long double functions
> +   are implemented independently from newlib to be able to use optimized
> +   assembler functions despite using the Microsoft x86_64 ABI. */ #if 
> +defined (_LDBL_EQ_DBL) || defined (__CYGWIN__) #ifndef __math_68881 
> +#define NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS 1 #endif #endif
> +
> +#endif


More information about the devel mailing list