This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC] What about removing #ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS??
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Paolo Carlini <pcarlini at unitus dot it>
- Cc: libstdc++ at gcc dot gnu dot org, phil at codesourcery dot com, bkoz at nabi dot net
- Date: Fri, 10 Oct 2003 10:05:25 -0500
- Subject: Re: [RFC] What about removing #ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS??
- Organization: Red Hat / Chicago
- References: <3F86934E.7080102@unitus.it>
>I can clearly remember a message by Phil, pointing out, to my wonder,
>that in fact, _GLIBCXX_RESOLVE_LIB_DEFECTS cannot be defined to false
>without breaking the build!
This is certainly true, and I think has always been true.
>Indeed, recently we have started putting the string in comments.
>
>So, what about changing /all/ the directives to simple comments? It
>seems to me that doing this would make the code less confusing for the
>user and would, moreover, make the work slightly easier for the frontend...
Seems fine, and harmless. The whole point of this guard was to be able
to mark spots where code may differ from the standard (although not from
the LWG Defect Reports.) To be specific:
Use this style:
basic_string.h
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 5 String::compare specification questionable
Not this (and include only the fixed code):
basic_string.tcc
#ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS
// 83. String::npos vs. string::max_size()
if (__capacity > _S_max_size)
#else
if (__capacity == npos)
#endif
-benjamin