This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: error_mark_node
- To: nathan at codesourcery dot com
- Subject: Re: error_mark_node
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Wed, 01 Nov 2000 07:38:49 -0800
- Cc: gcc at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <3A002541.D8A83424@codesourcery.com>
>>>>> "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