public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Haoxin Tu <haoxintu@gmail.com>
Cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: Is this program well-defined?
Date: Sat, 13 Nov 2021 09:47:11 +0000	[thread overview]
Message-ID: <CAH6eHdQX7K0AGMV3tSJkk9i5c=zCFKyDeWB7Ap2a+EJpHJWy0w@mail.gmail.com> (raw)
In-Reply-To: <CALDyosbeaddgnhnQw6kHMk3hCyWbXeL_J+Xdc5LkTB1cOHXivA@mail.gmail.com>

On Sat, 13 Nov 2021, 09:21 Haoxin Tu wrote:
>
> Hi all.
>
> I hope this is the right place to ask the question.


It's not IMHO. Questions like "is this a bug?" generally belong on the
gcc-help list, or just straight to bugzilla.

>
> My confusion is that whether the called function "func_2()" inside the
> "func_1" is defined or not.
>
> Can anyone help me to figure it out?


I think it's undefined, due to C17 6.5.2.2 p6:


If the expression that denotes the called function has a type that
does not include a prototype, the
integer promotions are performed on each argument, and arguments that
have type float are
promoted to double. These are called the default argument promotions.
If the number of arguments
does not equal the number of parameters, the behavior is undefined.

      reply	other threads:[~2021-11-13  9:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-13  9:20 Haoxin Tu
2021-11-13  9:47 ` Jonathan Wakely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH6eHdQX7K0AGMV3tSJkk9i5c=zCFKyDeWB7Ap2a+EJpHJWy0w@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=haoxintu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).