public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "nightstrike at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug testsuite/108675] FAIL: gcc.c-torture/execute/builtins/*printf.c when stdio.h includes definitions Date: Tue, 07 Feb 2023 05:51:34 +0000 [thread overview] Message-ID: <bug-108675-4-VGQyjrNLR1@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108675-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108675 --- Comment #8 from nightstrike <nightstrike at gmail dot com> --- (In reply to LIU Hao from comment #7) > (In reply to nightstrike from comment #5) > > (In reply to LIU Hao from comment #4) > > > Does it make any sense to remove `#include <stdio.h>` from > > > 'gcc.c-torture/execute/builtins/lib/fprintf.c' ? > > > > That will prevent the FILE type from existing, so the replacement functions > > won't compile. > > That file never uses any fields of `FILE` directly. `FILE*` is always passed > as a pointer to `vfprintf()`, so it is perfectly valid to declare > > typedef struct _iobuf FILE; > > or even > > int fprintf (void* fp, const char* fmt, ...); Removing "include stdio" and changing both FILE*'s to void*'s does in fact make the test pass. Is this an acceptable way to pass the test? diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/fprintf.c b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/fprintf.c index 853a705e86d..75406298856 100644 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/lib/fprintf.c +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/lib/fprintf.c @@ -1,11 +1,11 @@ -#include <stdio.h> +//#include <stdio.h> #include <stdarg.h> extern void abort (void); extern int inside_main; __attribute__ ((__noinline__)) int -fprintf (FILE *fp, const char *string, ...) +fprintf (void *fp, const char *string, ...) { va_list ap; int r; @@ -22,7 +22,7 @@ fprintf (FILE *fp, const char *string, ...) /* Locking stdio doesn't matter for the purposes of this test. */ __attribute__ ((__noinline__)) int -fprintf_unlocked (FILE *fp, const char *string, ...) +fprintf_unlocked (void *fp, const char *string, ...) { va_list ap; int r;
next prev parent reply other threads:[~2023-02-07 5:51 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-05 5:51 [Bug testsuite/108675] New: " nightstrike at gmail dot com 2023-02-06 7:52 ` [Bug testsuite/108675] " rguenth at gcc dot gnu.org 2023-02-06 9:19 ` nightstrike at gmail dot com 2023-02-06 10:11 ` 10walls at gmail dot com 2023-02-06 10:42 ` lh_mouse at 126 dot com 2023-02-06 16:40 ` nightstrike at gmail dot com 2023-02-06 17:34 ` zack+srcbugz at owlfolio dot org 2023-02-07 2:12 ` lh_mouse at 126 dot com 2023-02-07 5:51 ` nightstrike at gmail dot com [this message] 2023-02-11 5:33 ` nightstrike at gmail dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-108675-4-VGQyjrNLR1@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).