[Bug 265425] [exp-run] Against llvm-15-update branch on GitHub

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 30 Jul 2022 17:55:04 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265425

Dimitry Andric <dim@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |brooks@FreeBSD.org

--- Comment #13 from Dimitry Andric <dim@FreeBSD.org> ---
I would like to solicit some feedback about a few huge (in my opinion at least)
behavior changes in clang 15, as compared to clang 14:

1) In
https://github.com/llvm/llvm-project/commit/7d644e1215b376ec5e915df9ea2eeb56e2d94626
("[C11/C2x] Change the behavior of the implicit function declaration warning"),
the -Wimplicit-function-declaration 'warning' became an error for C99 and
later.

2) In
https://github.com/llvm/llvm-project/commit/2cb2cd242ca08d0bbd2a51a41f1317442e5414fc
("Change the behavior of implicit int diagnostics"), the -Wimplicit-int
'warning' became an error for C99 and later.

Of all the errors in Antoine's logs, -Wimplicit-function-declaration is more
than half, and roughly 16% are -Wimplicit-int errors:

% grep error: *.log > errors.txt
% wc -l errors.txt
    3257 errors.txt
% grep Wimplicit-function-declaration errors.txt | wc -l
    1848
% grep Wimplicit-int errors.txt | wc -l
     525

I looked through a few ports, and while some of these can be 'fixed' by adding
USE_CSTD=gnu89 or USE_CSTD=c89, lots of them either don't respect the USE_CSTD=
setting or fail to pick up CFLAGS.

So I'm wondering whether it is worthwhile to partially revert upstream commits
1) and 2), turning the errors back into warnings again.

This would temporarily save us, until C2x becomes the default language dialect,
but at some point this technical debt must paid: e.g. all ports that use
"old-style" C (K&R, C89 without prototypes, implicit int etc etc) should
explicitly be marked such, or they have to be patched to use an older compiler.

What's the general opinion on this in the ports team?

(Btw, going through all these ports with a fine toothed comb is probably the
most future-proof, but I simply do not have the time for it.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.