public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* Mismatch between newlib and glibc regarding fileno
@ 2024-02-09 16:29 Torbjorn SVENSSON
  2024-02-09 16:40 ` Andrew Pinski
  0 siblings, 1 reply; 12+ messages in thread
From: Torbjorn SVENSSON @ 2024-02-09 16:29 UTC (permalink / raw)
  To: Newlib; +Cc: Yvan Roux

Hi all,

I've been trying to run tests for arm-none-eabi on GCC14 tree.
What I've seen is that fileno() is not available. If you look though the 
header files, I see that this is guarded by __POSIX_VISIBLE and due to a 
recent change in the GCC testsuite (part of PR96395), they moved the 
test case to gcc/testsuite/c-c++-common/analyzer/fileno-1.c and then 
invoke it with g++ and -std=c++98. With this change, strict ANSI is 
defined, but not __POSIX_VISIBLE.

If I run the same test on the native g++ tool in Ubuntu, I instead get 
that __USE_POSIX is set (the guard for fileno() in glibc), so this 
differs from the behavior noticed with newlib.


Is it correct that newlib does not define __POSIX_VISIBLE when g++ is 
invoked with -std=c++98 (or any other standard that does not use the GNU 
extensions)?
It can also be seen using gcc with -std=c11 for example, so it's not 
strictly a C vs C++ issue.


The expression used in glibc: 
https://github.com/bminor/glibc/blob/master/include/features.h#L335

The expression used in newlib: 
https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=newlib/libc/include/sys/features.h;h=6a925c87e9ec333fc51538201aa7b52d24b3ca5b;hb=refs/heads/main#l148


Kind regards,
Torbjörn

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-02-15 17:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09 16:29 Mismatch between newlib and glibc regarding fileno Torbjorn SVENSSON
2024-02-09 16:40 ` Andrew Pinski
2024-02-09 16:54   ` Corinna Vinschen
2024-02-12 15:36     ` Torbjorn SVENSSON
2024-02-12 16:33       ` Corinna Vinschen
2024-02-12 16:40         ` Corinna Vinschen
2024-02-12 17:11           ` Torbjorn SVENSSON
2024-02-12 17:44             ` Corinna Vinschen
2024-02-12 18:14         ` Joseph Myers
2024-02-12 19:27           ` Torbjorn SVENSSON
2024-02-12 19:40             ` Corinna Vinschen
2024-02-15 17:36               ` Torbjorn SVENSSON

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).