public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/108675] New: FAIL: gcc.c-torture/execute/builtins/*printf.c when stdio.h includes definitions
@ 2023-02-05  5:51 nightstrike at gmail dot com
  2023-02-06  7:52 ` [Bug testsuite/108675] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: nightstrike at gmail dot com @ 2023-02-05  5:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108675

            Bug ID: 108675
           Summary: FAIL: gcc.c-torture/execute/builtins/*printf.c when
                    stdio.h includes definitions
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nightstrike at gmail dot com
  Target Milestone: ---

Failing tests:
gcc.c-torture/execute/builtins/printf.c
gcc.c-torture/execute/builtins/fprintf.c
gcc.c-torture/execute/builtins/sprintf.c

On mingw-w64, the gcc.c-torture/execute/builtins/*printf.c tests fail.  We
include definitions of various functions in stdio.h instead of just
declarations, leading to redefinition errors.  For example,

https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-headers/crt/stdio.h:
__mingw_ovr
__attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
int fprintf (FILE *__stream, const char *__format, ...)
{
  int __retval;
  __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
  __retval = __mingw_vfprintf( __stream, __format, __local_argv );
  __builtin_va_end( __local_argv );
  return __retval;
}

This causes the test to fail to compile at all optimization levels:
gcc.c-torture/execute/builtins/lib/fprintf.c:8:1: error: redefinition of
'fprintf'
mingw13/x86_64-w64-mingw32/include/stdio.h:357:5: note: previous definition of
'fprintf' with type 'int(FILE *, const char *, ...)' {aka 'int(struct _iobuf *,
const char *, ...)'}

The tests were originally added in r38065, r38788, and r48335.  They were later
moved in r84044 and tweaked a bit.

Is there a better way to verify that the builtin was used instead of mingw
version?

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

end of thread, other threads:[~2023-02-11  5:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-05  5:51 [Bug testsuite/108675] New: FAIL: gcc.c-torture/execute/builtins/*printf.c when stdio.h includes definitions 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
2023-02-11  5:33 ` nightstrike at gmail dot com

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).