This is the mail archive of the gcc@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: Warning elimination patches in cp/call.c



  In message <199803101742.JAA19093@atrus.synopsys.com>you write:
  > > Yes, there may be a few that should be aborts.  But the behavior with
  > > the default: break case matches the current behavior -- which is
  > > what I think we want to do unless we know its wrong (as has been
  > > the case for some of the suggested paren warning fixes).
  > 
  > It seems that inserting default: break should be fine in most cases.  The
  > only exception is where each case computes a needed result or returns a
  > value; here default: break won't compute the result or return a value, so
  > it seems that there should be a default: abort in such cases (otherwise
  > we'll wind up with an uninitialized variable or fall off the end of
  > a function).
Yup.  In face I've already fixed a couple where a break caused us
to drop off the end of a non-void function without returning a 
value.  Of course -Wall told me I'd fallen off the end of the
non-void function :-)


jeff


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