URL: <http://savannah.nongnu.org/bugs/?37825>
Summary: math.h wrong code and not C90 compliant Project: AVR C Runtime Library Submitted by: gjlayde Submitted on: Mi 28 Nov 2012 23:06:19 GMT Category: Header 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: 1.8.0 Fixed Release: None _______________________________________________________ Details: math.h uses inline which is not C90 (similar to bug 36921 with util/delay.h), here SVN 2264: __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( "mov %0, %C1 nt" "lsl %0 nt" "mov %0, %D1 nt" "rol %0 " : "=r" (__exp) : "r" (__x) ); return __exp != 0xff; } inline is available in C99, not in C90. You can use __inline__ or __inline. Same applies to copyfign. Moreover, it is advisable to always inline this: __ATTR_CONST__ static __inline__ __attribute__((__always_inline__)) int isfinite (const double __x) This function might produce wrong code because the first instruction might clobber the input by overwriting %D1 . One solution is to early-clobber the output by means of & _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/bugs/?37825> _______________________________________________ Nachricht gesendet von/durch Savannah http://savannah.nongnu.org/ _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-libc-dev