This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: bypassing g++-STL purify UMR wanings.


Yotam Medini wrote:
> 
> I have a quick and dirty bypass that solves
> some (all?) undeired UMR's form g++'s STL.
> This is by adding 2 lines to:
>   <g++-root>/include/g++/type_traits.h
> 
> Change:
> ------------------------------------------------------------------------
> struct __true_type {
> };
> 
> struct __false_type {
> };
> -----------------------------------------------------------------------
> into:
> -----------------------------------------------------------------------
> struct __true_type {
>  __true_type() : bdum(true) {}
>  private: bool bdum;
> };
> 
> struct __false_type {
>  __false_type() : bdum(false) {}
>  private: bool bdum;
> };
Actually, you don't need to do this.  The following definitions of __true_type
and __false_type will eliminate purify warnings, also:

struct __true_type {
 __true_type() {}
  __true_type(const __true_type&) {}
};

struct __false_type {
 __false_type(){}
  __false_type(const __false_type&) {}
};

For more information on this, you should also take a look at an earlier
discussion of this same topic in egcs-bugs.  You can find that discussion by
looking at this web-page:

http://www.cygnus.com/ml/egcs-bugs/1998-Feb/

The relevant thread is "purify 4.1 and egcs still appear to be incompatible." 
Also relevant is the thread "weird code generation differences without
optimization".  In these threads, Jason Merrill posted some good ideas for
fixes to g++ that would do away with these UMR's.
-- 
Ian Haggard  ||  ian@shellus.com (work)  ||  IanHaggard@juno.com (home)
GNU/Linux -- "Oh, no, Mr Bill!" || #define employer_opinion !my_opinion


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