This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: -Wmissing-pure/-Wmissing-const/-Wmissing-nothrow


> 2009/7/3 Jan Hubicka <hubicka@ucw.cz>:
> >> 2009/7/2 Jan Hubicka <hubicka@ucw.cz>:
> >> >> 2009/7/2 Jan Hubicka <hubicka@ucw.cz>:
> >> >
> >> > Well, I added it there just because other warnings was there. ?I can put
> >> > it to tree.h, but tree.h looks bit too generic...
> >>
> >> warn_deprecated_use is defined in toplev.c, so at least it makes sense
> >> it is declared in toplevel.h. But it is only used by the C and C++
> >
> > I also need to include toplev.h for warning function itself.
> >
> > Here is updated patch. ?It adds comment about warnings being more active
> > at hither optimization levels (nothrow is to limited degree done at -O0
> > too, const/pure needs -O1 ATM), it also moves declaration to tree.h,
> > updates the hashtable query. ?I didn't updated the -Wmidding-attribute=
> > but if it seems better, I will do that as followup.
> >
> > Regtested x86_64-linux, I am re-bootstrapping now, OK?
> 
> Could you address my earlier comments?
> 
> We should distinguish between GCC attribute nothrow and
> C++ 'throw()' specification.  The latter has viral effects on
> function types.

I think in earlier discussion we concluded that all cases you get the
warning, throw() won't cause any problems.

throw() has closure property - i.e. when you mark some function with
throw(), you are better to be sure to do the job on all its callees or
you get extra must_not_throw region covering the marked function
increasing code size.

Because compiler can detect only functions where all callees are either
caught or can't throw, this won't happen.  However if you can make
compact description of the situation that would fit in -Wmissing-nothrow
documentation, I am all for it.  The difference is stubble and unlikely
understood by many users.

Concerning -Wmissing-* stuff, I just copied what we do for
-Wmissing-noreturn warning.  Do we want to change that one too?

Honza


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