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: error_mark_node


>>>>> "Nathan" == Nathan Sidwell <nathan@codesourcery.com> writes:

    Nathan> Which way should we standardize on? My vote is for the
    Nathan> latter treatment -- accept an error mark, and return it
    Nathan> (or otherwise NOP).

Yes, this has been bugging me for a long time.

One thing we need to do here (good project, Nathan, if you want to do
it), is to make an error_type, error_decl, etc. so that existing
routines can easily deal with errors.  For example, TYPE_SIZE_UNIT of
the error_type, could just be size_one_node.  That would actually
eliminate the need for a lot of the checks that we have in the code.
If you type `foo_t *' and the `foo_t' isn't a type, we could make a
POINTER_TYPE to an ERROR_TYPE, and most things would just work.  Then,
routines that switch on kinds of types would have to deal with
ERROR_TYPEs, but you wouldn't have the current breakdown in dynamic
typesafety that comes with error_mark_node.

I agree that it should be callees who check for the errors; not the
callers.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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