Bug 13775 - dprintf and vdprintf are undefined if -D_GNU_SOURCE
Summary: dprintf and vdprintf are undefined if -D_GNU_SOURCE
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: stdio (show other bugs)
Version: 2.13
: P2 normal
Target Milestone: ---
Assignee: Roland McGrath
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-27 21:18 UTC by Matthew McClintock
Modified: 2014-06-26 14:18 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew McClintock 2012-02-27 21:18:29 UTC
See the following errors:

# gcc -o test -D_GNU_SOURCE  test.c    
In file included from /usr/include/stdio.h:933:0,
                 from test.c:1:
/usr/include/bits/stdio-ldbl.h:67:1: error: 'vdprintf' undeclared here (not in a function)
/usr/include/bits/stdio-ldbl.h:68:1: error: 'dprintf' undeclared here (not in a function)
test.c: In function 'main':
test.c:9:16: error: called object 'dprintf' is not a function

Seems to be related to in appropriate ifdef. Full test case below:

https://gist.github.com/1927104
Comment 1 Roland McGrath 2012-02-27 21:22:31 UTC
The report omits the essential information, which is the configuration.
This only affects __LDBL_COMPAT configurations such as powerpc.
Comment 2 Roland McGrath 2012-02-27 22:03:26 UTC
I committed a fix on the trunk (commit 36c8acb) though I did not test it on
an affected configuration.

I don't think the bug actually appeared for this case on the trunk
beforehand, because _GNU_SOURCE gets __USE_XOPEN2K8.  But probably there
was some other bug in 2.13 like _POSIX_C_SOURCE defaulting wrongly for
_GNU_SOURCE.
Comment 3 Matthew McClintock 2012-02-28 17:00:48 UTC
Rebuilding gcc with 'with-long-double-128' also fixes this issue... that makes sense though, since these DEFINES are sort of related to that bit?

Going to retest with just the header fix now.

-M
Comment 4 Roland McGrath 2012-02-28 17:36:15 UTC
Yes, that's expected.  The problematic code is for machines that can have a new long double type, but previously didn't.