Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

The C++ Standard Library also incorporates 18 headers of the ISO C90 C standard library ending with ".h", but their use is deprecated.

71 views
Skip to first unread message

mathieu

unread,
Sep 24, 2015, 9:56:26 AM9/24/15
to
I am reading the C++ wikimedia page:

https://en.wikipedia.org/wiki/C%2B%2B_Standard_Library

The introduction starts with:

[...]
The C++ Standard Library also incorporates 18 headers of the ISO C90 C standard library ending with ".h", but their use is deprecated.
[...]

I must have been living under a rock: I did not know this was being deprecated. Any reference on this ? and why ?

Thanks.

Paavo Helde

unread,
Sep 24, 2015, 11:01:36 AM9/24/15
to
mathieu <mathieu....@gmail.com> wrote in
news:6da90fee-24a9-41ba...@googlegroups.com:
This is straight from Annex D in C++ 2003 and later (possibly also
earlier) standards which among other things is listing these C headers
and which is also referenced by the wikipedia article:

"These are deprecated features, where deprecated is defined as: Normative
for the current edition of the Standard, but not guaranteed to be part of
the Standard in future revisions."

As to why, then I guess the main reason is that these headers pollute the
global namespace and may conflict with the same names defined by the C
implementations (e.g. ::abs() truncating its argument to an integer).

Cheers
Paavo

Anand Hariharan

unread,
Sep 24, 2015, 12:01:53 PM9/24/15
to
http://stackoverflow.com/a/13040283

C++11 extended latitude to the library implementers to put those names in the global namespace. So C++03 had it right, then C++11 loosened it quite a bit. Will they consider slowly tightening it back to where they started?


Bo Persson

unread,
Sep 24, 2015, 3:52:37 PM9/24/15
to
Not likely. The rules were loosened because most of the major
implementations failed in this regard.


Bo Persson

Juha Nieminen

unread,
Sep 28, 2015, 4:51:46 AM9/28/15
to
mathieu <mathieu....@gmail.com> wrote:
> [...]
> The C++ Standard Library also incorporates 18 headers of the ISO C90 C standard library ending with ".h", but their use is deprecated.
> [...]
>
> I must have been living under a rock: I did not know this was being deprecated. Any reference on this ? and why ?

I think that it's referring to standard include files inherited from C using
the .h suffix, which is deprecated. The non-deprecated versions omit the .h
(and add a 'c' at the beginning of the header file name, such as <cstdio>.)

--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---
0 new messages