public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* A silly question regarding function types
@ 2020-09-04  2:37 Gary Oblock
  2020-09-04  7:13 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Gary Oblock @ 2020-09-04  2:37 UTC (permalink / raw)
  To: gcc

Note, isn't a problem, rather, it's something that puzzles me.

On walking a function types argument types this way

for ( arg = TYPE_ARG_TYPES ( func_type);
       arg != NULL;
       arg = TREE_CHAIN ( arg))
    {
       .
       .
     }

I noticed an extra void argument that didn't exist
tagged on the end.

I then noticed other code doing this (which I copied:)

for ( arg = TYPE_ARG_TYPES ( func_type);
        arg != NULL && arg != void_list_node;
        arg = TREE_CHAIN ( arg))
     {
         .
         .
      }

What is going on here???

Thanks,

Gary



CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and contains information that is confidential and proprietary to Ampere Computing or its subsidiaries. It is to be used solely for the purpose of furthering the parties' business relationship. Any unauthorized review, copying, or distribution of this email (or any attachments thereto) is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete the original and any copies of this email and any attachments thereto.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: A silly question regarding function types
  2020-09-04  2:37 A silly question regarding function types Gary Oblock
@ 2020-09-04  7:13 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2020-09-04  7:13 UTC (permalink / raw)
  To: Gary Oblock; +Cc: gcc

On Fri, Sep 4, 2020 at 4:39 AM Gary Oblock via Gcc <gcc@gcc.gnu.org> wrote:
>
> Note, isn't a problem, rather, it's something that puzzles me.
>
> On walking a function types argument types this way
>
> for ( arg = TYPE_ARG_TYPES ( func_type);
>        arg != NULL;
>        arg = TREE_CHAIN ( arg))
>     {
>        .
>        .
>      }
>
> I noticed an extra void argument that didn't exist
> tagged on the end.
>
> I then noticed other code doing this (which I copied:)
>
> for ( arg = TYPE_ARG_TYPES ( func_type);
>         arg != NULL && arg != void_list_node;
>         arg = TREE_CHAIN ( arg))
>      {
>          .
>          .
>       }
>
> What is going on here???

Without a void_list_node on the end it's a variadic function

> Thanks,
>
> Gary
>
>
>
> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and contains information that is confidential and proprietary to Ampere Computing or its subsidiaries. It is to be used solely for the purpose of furthering the parties' business relationship. Any unauthorized review, copying, or distribution of this email (or any attachments thereto) is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete the original and any copies of this email and any attachments thereto.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-04  7:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-04  2:37 A silly question regarding function types Gary Oblock
2020-09-04  7:13 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).