public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Ionen Wolkens <ionen@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] Clang 16 is coming - and it'll break your packages!
Date: Tue, 11 Oct 2022 05:07:24 -0400	[thread overview]
Message-ID: <Y0UyTMwVIJqAmnYs@eversor> (raw)
In-Reply-To: <87tu4c8z49.fsf@mop.mail-host-address-is-not-set>

[-- Attachment #1: Type: text/plain, Size: 1535 bytes --]

On Sun, Oct 09, 2022 at 10:25:47PM +0100, Sam James wrote:
> ## Bonus
> 
> It also *warns* about K&R declarations and ill-defined, deprecated
> prototypes,
> so for bonus work, test with:
> * -Werror=strict-prototypes (C only)
> * -Werror=deprecated-non-prototype (C only)
> 
> It's suggested that if you don't want to fix these errors, you try
> adding the -std=gnu89 flag instead.

Note that -Werror=strict-prototypes breaks /tons/ because it fails on
the following:

    int myfunc() { return 0; }

But the above is fine with -std=c2x, and I don't think it's worth
starting to add (void) /everywhere/ downstream if it's going to be
okay'ish.

"Hopefully" clang won't try to do that check by default again, the
breakage would be on the next level... so I'd tentatively say, don't
worry about this and focus attention where it's more urgent (aka
implicits and incompatible pointer types, may even fix other bugs
at same time).


On the other hand, warnings from -Wdeprecated-non-prototype do
fail with `clang -std=c2x`. So if come across a K&R-style source
mostly beyond fixing, do consider `append-cflags -std=gnu89`.

An alternative way to test so don't need to add -Wno* everywhere on
top of -std=gnu* is to straight up test with `clang -std=c2x` rather
than the -Werror (not to say it's perfect given c2x makes assumptions,
but doing this can pick up more errors too).

(reminder that gcc/clang don't enable c2x by default and isn't urgent,
but this will happen sooner or later)
-- 
ionen

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      parent reply	other threads:[~2022-10-11  9:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-09 21:25 [gentoo-dev] Clang 16 is coming - and it'll break your packages! Sam James
2022-10-09 22:00 ` Sam James
2022-10-10  2:05 ` Michael Orlitzky
2022-10-11  9:07 ` Ionen Wolkens [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=Y0UyTMwVIJqAmnYs@eversor \
    --to=ionen@gentoo.org \
    --cc=gentoo-dev@lists.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