public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* Re: [gentoo-dev] Clang 16 is coming - and it'll break your packages!
  @ 2022-10-11  9:07 99% ` Ionen Wolkens
  0 siblings, 0 replies; 1+ results
From: Ionen Wolkens @ 2022-10-11  9:07 UTC (permalink / raw
  To: gentoo-dev

[-- 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 --]

^ permalink raw reply	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-10-09 21:25     [gentoo-dev] Clang 16 is coming - and it'll break your packages! Sam James
2022-10-11  9:07 99% ` Ionen Wolkens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox