public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/113278] New: analyzer tests relying on fileno() fail on arm-eabi
@ 2024-01-08 17:24 clyon at gcc dot gnu.org
2024-01-08 18:01 ` [Bug testsuite/113278] " rearnsha at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: clyon at gcc dot gnu.org @ 2024-01-08 17:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113278
Bug ID: 113278
Summary: analyzer tests relying on fileno() fail on arm-eabi
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: testsuite
Assignee: unassigned at gcc dot gnu.org
Reporter: clyon at gcc dot gnu.org
Target Milestone: ---
Target: arm-eabi
A few analyzer tests relying on fileno() fail on arm-eabi:
c-c++-common/analyzer/fileno-1.c
c-c++-common/analyzer/flex-with-call-summaries.c
c-c++-common/analyzer/flex-without-call-summaries.c
g++.log contains:
gcc/testsuite/c-c++-common/analyzer/fileno-1.c:5:10: error: 'fileno' was not
declared in this scope
newlib does provide fileno() but maybe it's actually a newlib bug, or a bug in
the way we build it.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug testsuite/113278] analyzer tests relying on fileno() fail on arm-eabi
2024-01-08 17:24 [Bug testsuite/113278] New: analyzer tests relying on fileno() fail on arm-eabi clyon at gcc dot gnu.org
@ 2024-01-08 18:01 ` rearnsha at gcc dot gnu.org
2024-01-09 3:23 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2024-01-08 18:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113278
--- Comment #1 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
newlib certainly implements fileno():
$ nm libc.a|grep fileno
libc_a-fileno.o:
00000000 T fileno
U fileno
libc_a-fileno_u.o:
00000000 T fileno_unlocked
U fileno
So perhaps the issue is that the prototype is missing (or missing with the
default compilation options since it's Posix and I don't think we pass options
to enable that by default). Grepping the source, I suspect the former.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug testsuite/113278] analyzer tests relying on fileno() fail on arm-eabi
2024-01-08 17:24 [Bug testsuite/113278] New: analyzer tests relying on fileno() fail on arm-eabi clyon at gcc dot gnu.org
2024-01-08 18:01 ` [Bug testsuite/113278] " rearnsha at gcc dot gnu.org
@ 2024-01-09 3:23 ` pinskia at gcc dot gnu.org
2024-02-15 17:09 ` torbjorn.svensson at foss dot st.com
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-09 3:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113278
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2024-01-09
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So for C++, -std=c++98 (and others) are passed which causes __STRICT_ANSI__ to
be defined which in turn newlib decides not to enable POSIX functions (via
defining _DEFAULT_SOURCE which defines _POSIX_SOURCE).
So confirmed, this is just a testsuite issue and the simple way of fixing this
is to add -D_GNU_SOURCE to the command line options which causes the POSIX
functions in stdio.h to be declared.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug testsuite/113278] analyzer tests relying on fileno() fail on arm-eabi
2024-01-08 17:24 [Bug testsuite/113278] New: analyzer tests relying on fileno() fail on arm-eabi clyon at gcc dot gnu.org
2024-01-08 18:01 ` [Bug testsuite/113278] " rearnsha at gcc dot gnu.org
2024-01-09 3:23 ` pinskia at gcc dot gnu.org
@ 2024-02-15 17:09 ` torbjorn.svensson at foss dot st.com
2024-02-15 17:31 ` cvs-commit at gcc dot gnu.org
2024-02-19 9:17 ` azoff at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: torbjorn.svensson at foss dot st.com @ 2024-02-15 17:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113278
Torbjörn SVENSSON <torbjorn.svensson at foss dot st.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |torbjorn.svensson at foss dot st.c
| |om
--- Comment #3 from Torbjörn SVENSSON <torbjorn.svensson at foss dot st.com> ---
Patch sent: https://gcc.gnu.org/pipermail/gcc-patches/2024-February/645731.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug testsuite/113278] analyzer tests relying on fileno() fail on arm-eabi
2024-01-08 17:24 [Bug testsuite/113278] New: analyzer tests relying on fileno() fail on arm-eabi clyon at gcc dot gnu.org
` (2 preceding siblings ...)
2024-02-15 17:09 ` torbjorn.svensson at foss dot st.com
@ 2024-02-15 17:31 ` cvs-commit at gcc dot gnu.org
2024-02-19 9:17 ` azoff at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-15 17:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113278
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Torbjorn Svensson <azoff@gcc.gnu.org>:
https://gcc.gnu.org/g:8e8c2d2b34971bb29e74341a3efc625f1db06639
commit r14-9015-g8e8c2d2b34971bb29e74341a3efc625f1db06639
Author: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Date: Thu Feb 15 17:46:24 2024 +0100
testsuite: Define _POSIX_SOURCE for tests [PR113278]
As the tests assume that fileno() is visible (only part of POSIX),
define the guard to ensure that it's visible. Currently, glibc appears
to always have this defined in C++, newlib does not.
Without this patch, fails like this can be seen:
Testing analyzer/fileno-1.c, -std=c++98
.../fileno-1.c: In function 'int test_pass_through(FILE*)':
.../fileno-1.c:5:10: error: 'fileno' was not declared in this scope
FAIL: c-c++-common/analyzer/fileno-1.c -std=c++98 (test for excess errors)
Patch has been verified on Linux.
gcc/testsuite/ChangeLog:
PR testsuite/113278
* c-c++-common/analyzer/fileno-1.c: Define _POSIX_SOURCE.
* c-c++-common/analyzer/flex-with-call-summaries.c: Same.
* c-c++-common/analyzer/flex-without-call-summaries.c: Same.
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug testsuite/113278] analyzer tests relying on fileno() fail on arm-eabi
2024-01-08 17:24 [Bug testsuite/113278] New: analyzer tests relying on fileno() fail on arm-eabi clyon at gcc dot gnu.org
` (3 preceding siblings ...)
2024-02-15 17:31 ` cvs-commit at gcc dot gnu.org
@ 2024-02-19 9:17 ` azoff at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: azoff at gcc dot gnu.org @ 2024-02-19 9:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113278
Torbjorn SVENSSON <azoff at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |azoff at gcc dot gnu.org
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #5 from Torbjorn SVENSSON <azoff at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-02-19 9:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-08 17:24 [Bug testsuite/113278] New: analyzer tests relying on fileno() fail on arm-eabi clyon at gcc dot gnu.org
2024-01-08 18:01 ` [Bug testsuite/113278] " rearnsha at gcc dot gnu.org
2024-01-09 3:23 ` pinskia at gcc dot gnu.org
2024-02-15 17:09 ` torbjorn.svensson at foss dot st.com
2024-02-15 17:31 ` cvs-commit at gcc dot gnu.org
2024-02-19 9:17 ` azoff at gcc dot gnu.org
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).