<cstdio> doesn't contain vasprintf() and asprintf()

Bug #332115 reported by Uqbar
2
Affects Status Importance Assigned to Milestone
gcc
Invalid
Medium
gcc-4.3 (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Binary package hint: libstdc++6-4.3-dev

While the documentation states that vasprintf and asprintf belong to the the <stdio.h> header, the C++ header <cstdio> doesn't contain any definition to them, thus forcing one to also #include <stdio.h>

'lsb_release -rd'
Description: Ubuntu 8.10
Release: 8.10

g++ -v:
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu12' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)

Revision history for this message
Uqbar (uqbar) wrote :

I attach the current actual <cstdio> file here below.

Matthias Klose (doko)
Changed in gcc-4.3 (Ubuntu):
importance: Undecided → Low
status: New → Triaged
Changed in gcc:
status: Unknown → New
Revision history for this message
Matthias Klose (doko) wrote :

closed as invalid by upstream:
> This is definitely not a bug. Note, in our implementation <stdio.h> is included
> anyway from <cstdio> as an implementation detail.

Changed in gcc-4.3 (Ubuntu):
status: Triaged → Invalid
Revision history for this message
Uqbar (uqbar) wrote :

So why vasprintf() and asprintf() are not available after inclusion of <cstdio>?
In <stdio.h> vasprintf() and asprintf() get declared within
#ifdef __USE_GNU
....
#endif

Changed in gcc:
status: New → Invalid
Revision history for this message
Uqbar (uqbar) wrote :

In C and C++ if I #include <stdio.h> I get asprintf() and vasprintf().
In C++ if I #include <cstdio> I DON'T get asprintf() and vasprintf().
If this is not a wanted feature, it'd definitely be a bug.
If it's not, who is the maintainer?

Quoting from the cstdio file:

/** @file include/cstdio
 * This is a Standard C++ Library file. You should @c #include this file
 * in your programs, rather than any of the "*.h" implementation files.
 *
 * This is the C++ version of the Standard C Library header @c stdio.h,
 * and its contents are (mostly) the same as that header, but are all
 * contained in the namespace @c std (except for names which are defined
 * as macros in C).
 */

Changed in gcc:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.