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