This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A question about TYPE_ARG_TYPES
- From: Ian Lance Taylor <iant at google dot com>
- To: Kazu Hirata <kazu at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org, mark at codesourcery dot com
- Date: 05 Jul 2006 08:43:01 -0700
- Subject: Re: A question about TYPE_ARG_TYPES
- References: <200607051457.k65EvYx3020685@sparrowhawk.codesourcery.com>
Kazu Hirata <kazu@codesourcery.com> writes:
> I keep finding places in GCC sources that check whether a member of
> TYPE_ARG_TYPES is 0. For example,
>
> for (link = TYPE_ARG_TYPES (function_or_method_type);
> link && TREE_VALUE (link);
> link = TREE_CHAIN (link))
> gen_type_die (TREE_VALUE (link), context_die);
>
> Notice that TREE_VALUE (link) is part of the loop condition.
>
> Now, do we ever allow a NULL in TYPE_ARG_TYPES? If so, what does that
> mean? My guess is that soneone was trying to be cautious about
> encountering a NULL in TYPE_ARG_TYPES. (If that's the case, we should
> be using gcc_assert instead.)
Just guessing here, but what happens with an old-style function
definition in C?
void f();
Ian