[#6584] rint in c99 results in warning
Submitted By: Anton Shokurov
2011-05-10 05:03:33 Close Date
N/A Silicon Revision:
Fixed Fixed In Release:
Host Operating System:
Closed Found In Release:
Is this bug repeatable?:
Summary: rint in c99 results in warning
Isn't rint (and the like) part of c99?
I get a compiler warning if i compile the code with -std=c99, but if i compile with -std=gnu99 i don't get any warnings.
--- Stuart Henderson 2011-05-10 10:08:22
rint et al are indeed part of c99 and should work. Can you provide example code
and a command line to reproduce the warning?
--- Anton Shokurov 2011-05-10 11:29:42
Yes, i posted the file
>bfin-elf-gcc -std=c99 test_rint.c -c
test_rint.c: In function 'main':
test_rint.c:7: warning: implicit declaration of function 'rint'
test_rint.c:7: warning: incompatible implicit declaration of built-in function
>bfin-elf-gcc -std=gnu99 test_rint.c -c
runs without any warnings.
--- Mike Frysinger 2011-05-10 11:50:37
please fill out all the fields in the bug. you have to provide as many details
as possible for the report to be useful.
gcc-4.3.5 works just fine for me -- no warnings.
--- Stuart Henderson 2011-05-10 12:17:20
ah, the problem is with the bare metal toolchain. the version of newlib
included with the 2010R1 release (which i'm assuming you're using) was 1.14.0,
the math.h included with this release contains a bug where fint et al are only
which is clearly wrong since it should be included for c99. This has since
been updated in the 1.19.0 release that we will use for the 2011 release:
#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >=
Since the section it's guarding is titled "/* ISO C99 types and macros.
*/", it should be ok to just update this #if in your:
to avoid these warnings.
--- Anton Shokurov 2011-05-10 13:41:05
Yes, the problem is with the bare metal toolchain.
When will the 2011 release be available?
>it should be ok to just update this
Yes, thanks, this worked for me. But nevertheless, when will the update be
--- Stuart Henderson 2011-05-11 06:41:16
It's too early to give an accurate picture of when the final 2011R1 release will
be made, however there is an alpha release available for download now if you
want to try it out:
File Name File Type File Size Posted By
test_rint.c text/x-csrc 167 Anton Shokurov