This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] What about removing #ifdef _GLIBCXX_RESOLVE_LIB_DEFECTS??


>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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]