[RFC] What about removing #ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS??

Benjamin Kosnik bkoz@redhat.com
Fri Oct 10 15:05:00 GMT 2003


>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



More information about the Libstdc++ mailing list