Summary: | GCC -std=gnu89 (default) does not handle round() from math.h | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jean-Francis Roy <jeanfrancis> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED INVALID | ||
Severity: | normal | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Jean-Francis Roy
2010-04-01 22:09:19 UTC
I think you forgot to attach roundtest.c. I think this is a bug in funtoo. I downloaded and extracted stage3-core2-2010.04.01.tar.bz2 and chrooted into it. Then: $ echo -e '#include <math.h>\nint main() { round(1.1); }' > test.c $ gcc -o test test.c test.c: In function ‘main’: test.c:2: warning: incompatible implicit declaration of built-in function ‘round’ $ gcc -std=gnu89 -o test test.c test.c: In function ‘main’: test.c:2: warning: incompatible implicit declaration of built-in function ‘round’ It's not a bug. It's just that Funtoo is using an older version of glibc (2.9_p20081201-r2), before this was added: #if (_POSIX_C_SOURCE - 0) >= 200112L # define __USE_XOPEN2K 1 +# undef __USE_ISOC99 +# define __USE_ISOC99 1 #endif (In reply to comment #2) > #if (_POSIX_C_SOURCE - 0) >= 200112L > # define __USE_XOPEN2K 1 > +# undef __USE_ISOC99 > +# define __USE_ISOC99 1 > #endif > in features.h. Yep I actually forgot to attach roundtest.c. However, as Chris found out that was a Funtoo issue, I'm closing the bug with a resolution to INVALID. Thanks for the help! |