Discussion:
[avr-libc-dev] [bug #49984] fabs missing from libm implementation.
Georg-Johann Lay
2017-01-04 11:19:02 UTC
Permalink
URL:
<http://savannah.nongnu.org/bugs/?49984>

Summary: fabs missing from libm implementation.
Project: AVR C Runtime Library
Submitted by: gjlayde
Submitted on: Wed 04 Jan 2017 11:19:01 AM GMT
Category: Library
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Percent Complete: 0%
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 2.0.0
Fixed Release: None

_______________________________________________________

Details:

fabs is missing from the libm implementation:


#include <math.h>

float use_fabsf (float x)
{
return fabsf (x);
}

double use_fabs (double x)
{
return fabs (x);
}

int main (void) { return 0; }


* Compiling with -ffreestanding or with -fno-builtin will run against a linker
error use_fabs.o: In function `use_fabsf':
use_fabs.c:(.text+0x24): undefined reference to `fabs'
* Compiling with -std=c90 will run into "inline", which is not available in
C90: avr/include/math.h:341:42: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'int'
__ATTR_CONST__ static inline int isfinite (double __x)
^~~
/srv/local/gnu/install/gcc-6/avr/include/math.h:359:42: error: expected '=',
',', ';', 'asm' or '__attribute__' before 'double'
__ATTR_CONST__ static inline double copysign (double __x, double __y)


"inline" should be replaced by __inline__.





_______________________________________________________

Reply to this item at:

<http://savannah.nongnu.org/bugs/?49984>

_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
Georg-Johann Lay
2017-01-04 11:21:21 UTC
Permalink
Follow-up Comment #1, bug #49984 (project avr-libc):

Some text has been thrown away by the web interface:

* Linker error re. missing fabs implementation occurs of compiled with
-ffreestanding or with -fno-builtin

* Compiler error because of unknown key word "inline" occurrs in C90 mode.

_______________________________________________________

Reply to this item at:

<http://savannah.nongnu.org/bugs/?49984>

_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/

Loading...