This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib 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: libstc++ expectations for newlib's string.h



Benjamin Kosnik wrote:
> 
> > > > I'd just like to add that the problem shows up in the C++ header
> > > > bits/locale_facets.tcc which uses strdup.  This makes it impossible to
> > > > compile some otherwise-valid C++ programs with -ansi and the newlib
> > > > headers.
> 
> Well, I think the problem is with libstdc++ and not newlib. Correctly
> nailing C89, C99, and the GNU extensions into namespaces has proven to
> be difficult. I think there is no reason for newlib to alter includes
> for this case based on __cplusplus.

newlib and glibc have different behaviors in this case.  Are you saying
that
both are correct?  

> Instead, this should probably be fixed in the C++ library.

Fair enough.  I certianly won't argue that having so many somewhat
conflicting
standards isn't confusing.
 
> > > `-ansi'
> > >      In C mode, support all ANSI standard C programs.  In C++ mode,
> > >      remove GNU extensions that conflict with ISO C++.
> 
> This is incorrect for GNU C++ post 3.0.x, as _GNU_SOURCE is defined in
> CPLUSPLUS_CPP_SPEC.
> 
> This is currently a low-to-medium priority issue.

:( Do you have a fix in mind for this particular case?  Or a guiding 
thought?  We would be happy to try to fix the problems as we encounter
them if we knew what the rule of thumb was.

> -benjamin

--joel


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