From: Jakub Jelinek <jakub@redhat.com>
To: Jason Merrill <jason@redhat.com>
Cc: Jonathan Wakely <jwakely.gcc@gmail.com>,
"gcc@gcc.gnu.org" <gcc@gcc.gnu.org>,
arsen@aarsen.me, "Joseph S. Myers" <joseph@codesourcery.com>
Subject: Re: Handling of main() function for freestanding
Date: Fri, 7 Oct 2022 15:53:10 +0200 [thread overview]
Message-ID: <Y0AvRr7quU8uFyaz@tucnak> (raw)
In-Reply-To: <2489d88a-e80b-2f89-bac5-07c0b70bc175@redhat.com>
On Fri, Oct 07, 2022 at 09:51:31AM -0400, Jason Merrill wrote:
> > There are some tests that fail if we do that. For whatever reason,
> > they're checking the current semantics.
>
> > * gcc.dg/c11-noreturn-4.c: Add -fno-builtin-main to options.
> > * gcc.dg/inline-10.c: Likewise.
>
> IMO we still shouldn't emit these pedwarns when freestanding, we shouldn't
> require people to add another flag to avoid them.
>
> Adding the implicit return 0 unconditionally doesn't mean we also need to
> adopt all the other special treatment of main.
>
> And I guess we shouldn't implicitly return 0 if the function is declared
> noreturn.
>
> > * gcc.dg/noreturn-4.c: Likewise.
>
> I'd be inclined to drop this test.
Ok.
> > Arsen implemented Jakub's suggestion which is to add the implicit
> > return by default, but add -fno-builtin-main to restore the previous
> > behaviour. Is that acceptable? If not, can you and Jakub reach
> > consensus so that Arsen knows what to do instead?
> > His -fno-builtin-main patch is at
> > https://gcc.gnu.org/pipermail/gcc-patches/2022-September/602644.html
> > (This is the only one of his patch series not committed, and results
> > in 100s of FAILs for libstdc++ when testing with -fffreestanding).
Jakub
next prev parent reply other threads:[~2022-10-07 13:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-28 20:15 Jonathan Wakely
2022-09-29 6:00 ` Richard Biener
2022-09-29 7:12 ` Jakub Jelinek
2022-09-29 9:21 ` Jonathan Wakely
2022-10-04 22:25 ` Jason Merrill
2022-10-04 23:28 ` Joel Sherrill
2022-10-07 11:30 ` Jonathan Wakely
2022-10-07 13:51 ` Jason Merrill
2022-10-07 13:53 ` Jakub Jelinek [this message]
2022-10-13 17:03 ` Arsen Arsenović
2022-10-13 17:10 ` Jakub Jelinek
2022-10-13 17:26 ` Arsen Arsenović
2022-10-13 17:24 ` Jason Merrill
2022-10-13 20:14 ` Arsen Arsenović
2022-10-13 21:16 ` Jason Merrill
2022-10-14 10:04 ` Arsen Arsenović
2022-10-14 15:17 ` Jason Merrill
2022-10-21 10:33 ` Ping (c,c++): " Arsen Arsenović
2022-10-21 21:02 ` Joseph Myers
2022-10-23 11:54 ` Arsen Arsenović
2022-10-24 13:46 ` Jason Merrill
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=Y0AvRr7quU8uFyaz@tucnak \
--to=jakub@redhat.com \
--cc=arsen@aarsen.me \
--cc=gcc@gcc.gnu.org \
--cc=jason@redhat.com \
--cc=joseph@codesourcery.com \
--cc=jwakely.gcc@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).