From: Florian Weimer <fweimer@redhat.com>
To: "Arsen Arsenović via Gcc" <gcc@gcc.gnu.org>
Cc: "Sam James" <sam@gentoo.org>, "Arsen Arsenović" <arsen@aarsen.me>
Subject: Re: Report from the additional type errors for GCC 14 BoF at Cauldron
Date: Wed, 27 Sep 2023 06:44:48 +0200 [thread overview]
Message-ID: <87a5t8p6m7.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <86wmwcoabj.fsf@aarsen.me> ("Arsen =?utf-8?Q?Arsenovi=C4=87?= via Gcc"'s message of "Wed, 27 Sep 2023 00:06:08 +0200")
* Arsen Arsenović via Gcc:
> Sam James via Gcc <gcc@gcc.gnu.org> writes:
>
>> Florian Weimer via Gcc <gcc@gcc.gnu.org> writes:
>>
>>> My understanding of the consensus goes as follows:
>>>
>>> * We want to make some changes in this area for GCC 14.
>>> * We should do the same thing that Clang does: default to the relevant
>>> -Werror= options.
>>> * Unlike regular warnings, these warnings-as-errors should also apply
>>> to system headers.
>>> * At least implict-int and implicit-function-declaration should be
>>> upgraded to errors in this way.
>>> * It's too early to make the () changes and bool-as-keyword from C2X
>>> for GCC 14.
>>> * We should fix the missing scope of the int-conversion warnings
>>> (PR109827). Likweise for incompatible-pointer-types (PR109826).
>>>
>>> Is this summary accurate?
>>>
>>
>> I wasn't there, but this reflects my understanding & what I would've
>> said if I could've attended.
>>
>>> I think the open issues are:
>>>
>>> * Do we want to implement something else beside implicit-int and
>>> implicit-function-declaration? (Candidates are int-conversion and
>>> incompatible-pointer-types, and the void vs non-void part of
>>> return-type, maybe others as previously discussed on the list.)
>>
>> Ideally, I'd like both int-conversion + incompatible-pointer-types in
>> this cycle, but if we have to defer one, I'd say to keep int-conversion.
>
> +1, this seems reasonable. I'm not sure I can imagine any even
> half-legitimate use for falling off the end of functions and similar, so
> perhaps we should also take return-type? Is that part of C23?
Falling of the end of the function is legitimate if a no-return function
is called and not annotated as such, among other things. I don't think
we should warn or error for that by default.
The issue I'm concerned about is about “return;” in a function not
returning void, or “return expr;” in a function returning void. This
looks like related to implict int return types for functions. It's not
part of C99. There is no separate -W switch to control this warning.
It is on by default (as required by C99), unlike other aspects of
-Wreturn-type.
Thanks,
Florian
next prev parent reply other threads:[~2023-09-27 4:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 8:28 Florian Weimer
2023-09-26 9:22 ` Jakub Jelinek
2023-09-26 12:04 ` Florian Weimer
2023-09-26 12:22 ` Jeff Law
2023-09-26 13:42 ` Florian Weimer
2023-09-26 18:49 ` Sam James
2023-09-26 18:40 ` Sam James
2023-09-26 22:06 ` Arsen Arsenović
2023-09-27 4:44 ` Florian Weimer [this message]
2023-09-27 8:52 ` Anaya Shah
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=87a5t8p6m7.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=arsen@aarsen.me \
--cc=gcc@gcc.gnu.org \
--cc=sam@gentoo.org \
/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).