Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 870412 (c99-porting) - [Tracker] Modern C (C99) porting (default -Werror=implicit-function-declaration,implicit-int,int-conversion,incompatible-pointer-types)
Summary: [Tracker] Modern C (C99) porting (default -Werror=implicit-function-declarati...
Status: CONFIRMED
Alias: c99-porting
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo Quality Assurance Team
URL: https://wiki.gentoo.org/wiki/Modern_C...
Whiteboard: Summary, help, and lots of details at...
Keywords: PullRequest, Tracker
Depends on: 602656 716192 729526 734088 739154 769557 776667 815109 830268 830497 832016 836784 860441 869149 869998 870424 870430 870472 870481 870490 870502 870541 870550 870553 870556 870568 870574 870640 870643 870664 870709 870724 870778 870787 870793 870802 870820 870835 870850 870859 870892 870901 870952 870955 870970 870982 871012 871024 871033 871039 871078 871093 871096 871102 871123 871186 871189 871207 871261 871267 871294 871303 871354 871378 871387 871420 871429 871435 871441 871447 871450 871453 871456 871459 871468 871477 871504 871507 871519 871531 871537 871543 871567 871594 871597 871603 871699 871702 871933 873619 873631 874015 874018 874054 874081 874090 874096 874114 874291 874315 874378 874384 874402 874414 874423 874429 874432 874438 874444 874483 874507 874525 874552 874561 874564 874579 874582 874585 874621 874687 874699 874702 874708 874720 874732 874753 874894 874921 874936 874963 874966 874969 874972 875002 875005 875032 875035 875044 875056 875062 875086 875098 875101 875146 875233 875236 875239 875245 875266 875272 875275 875281 875410 875428 875431 875434 875437 875467 875470 875479 875482 875497 875506 875512 875530 875533 875659 875662 875719 875725 875746 875767 875770 876337 876346 876945 876947 876955 876999 877103 877105 877109 877121 877295 878613 878615 878617 878623 878627 878633 878641 879033 879525 879873 880341 880343 880353 880357 880365 880375 880411 880413 880419 880429 880451 880491 880603 880655 880799 880809 880811 880819 880827 880833 880835 880839 880843 880901 880905 880907 880913 880917 880925 880931 880935 880943 880949 880953 880955 880959 880965 880971 880983 880987 880997 881011 881017 881069 881071 881079 881087 881143 881209 881213 881215 881243 881245 881307 881311 881323 881421 881423 882029 882113 882121 882155 882183 882197 882223 882225 882241 882265 882271 882283 882303 882315 882345 882581 882585 882607 882657 882659 882713 882805 882927 883069 883095 883099 883101 883111 883117 883125 883205 883207 883211 883265 883267 883281 883299 883393 883421 883423 883463 883581 883587 883603 883661 883663 883703 883705 883707 883709 883747 883891 884015 884043 884249 884283 884303 884331 884345 884411 884663 884709 884743 884779 884823 884829 884883 884917 884925 885043 885057 885059 885061 885063 885095 885417 885467 885475 885523 885527 885531 885533 885563 885599 885611 885623 885697 885699 885711 885761 885769 885785 885841 885869 885871 885877 885885 885961 885963 885965 886065 886105 886127 886139 886169 886455 886457 886460 886461 886463 886464 886465 886466 886597 886609 887119 887123 887187 887209 887249 887333 887415 887445 887457 887623 887625 887637 887641 887643 887645 887647 887713 887865 887877 887879 887999 888003 888023 889555 891297 891533 892708 894196 894318 894322 894324 894328 894334 894370 894372 894382 894508 894552 894554 894560 894574 894642 894708 894712 894714 894716 894772 894774 894776 894794 894798 895026 895028 895030 895034 895036 895050 895052 895056 895062 895072 895182 895184 895262 895360 895362 895516 895540 895832 895838 895842 895846 895848 895878 895882 895884 895886 895888 895894 895898 895976 895978 895984 895988 896004 896006 896246 896266 896418 896426 897800 897818 897834 897836 897838 897842 897844 897860 897866 897946 897956 898072 898080 898086 898088 898094 898102 898114 898118 898120 898122 898126 898168 898174 898272 898274 898280 898282 898284 898290 898292 898294 898298 898302 898536 898538 898540 898552 898554 898564 898614 898616 898854 902851 903573 907421 909563 910521 911821 913559 915040 918599 918600 918601 918602 918650 918912 918941 918971 918983 918988 918995 918998 918999 919021 919058 919069 919076 919077 919078 919080 919084 919085 919087 919088 919089 919091 919092 919093 919094 919121 919162 919163 919167 919169 919176 919177 919178 919179 919180 919181 919182 919183 919184 919185 919187 919188 919189 919192 919193 919194 919195 919196 919197 919198 919199 919200 919203 919205 919209 919210 919211 919212 919213 919214 919215 919216 919218 919219 919220 919221 919222 919223 919224 919225 919226 919227 919228 919231 919233 919237 919238 919249 919250 919251 919252 919254 919256 919257 919258 919259 919261 919262 919264 919266 919269 919270 919277 919280 919282 919286 919287 919288 919294 919295 919296 919300 919301 919304 919323 919348 919358 919360 919361 919362 919363 919364 919365 919366 919367 919368 919369 919370 919371 919372 919375 919387 919388 919389 919390 919391 919392 919393 919402 919408 919409 919413 919421 919426 919442 919443 919458 919459 919460 919471 919489 919493 919501 919502 919578 919685 919758 919874 919875 919876 919877 919885 920060 920061 920062 920109 920156 920190 920193 920231 920273 920275 920312 920315 920316 920323 920324 920356 920362 920365 920369 920380 920450 920451 920452 920453 920454 920459 920460 920478 920521 920522 920523 920533 920639 920640 920641 920642 920768 920769 920770 920772 920773 920774 920775 920776 920810 920830 920880 920916 920917 920918 920936 921020 921021 921024 921025 921027 921028 921029 921030 921031 921087 921103 921110 921126 921135 921136 921137 921144 921145 921166 921185 921186 921214 921252 921254 921255 921256 921257 921258 921261 921351 921353 921364 921384 921385 921488 921489 921523 921570 921571 921572 921573 921601 921727 922326 922345 922434 922489 922572 922613 922621 922622 922624 922630 922633 922687 922688 922718 922951 923021 923042 923107 923113 923125 923170 923325 923406 923582 923628 923635 923636 923703 923788 923914 923937 923938 923939 924051 924053 924163 924209 924210 924211 924227 924316 924401 924424 924429 924486 924487 924488 924510 924673 924712 924761 924762 924859 924861 924887 924928 924969 924997 925011 925012 925077 925090 925102 925143 925144 925146 925178 925198 925199 925227 925229 925252 618302 628744 647358 661334 705800 712534 713662 714652 729820 740224 744328 748522 784092 813870 822261 829633 832666 834369 839648 849515 853721 855554 867655 869203 869242 869254 869299 869371 869380 869404 869539 869884 869980 869995 870004 870007 870043 870415 870418 870427 870433 870436 870445 870448 870451 870457 870460 870463 870466 870475 870478 870484 870487 870493 870499 870514 870517 870520 870523 870526 870535 870538 870544 870547 870559 870565 870571 870625 870631 870634 870637 870646 870649 870652 870655 870661 870667 870670 870673 870676 870679 870682 870685 870703 870706 870712 870718 870721 870727 870730 870733 870736 870739 870742 870745 870748 870751 870763 870769 870772 870775 870781 870784 870790 870796 870799 870805 870808 870811 870817 870829 870832 870838 870841 870844 870847 870853 870856 870862 870865 870868 870871 870883 870886 870889 870895 870898 870904 870907 870910 870916 870919 870925 870928 870940 870943 870946 870949 870958 870961 870964 870973 870979 870988 870991 870997 871000 871003 871009 871015 871027 871030 871036 871042 871045 871048 871051 871054 871057 871060 871063 871066 871069 871072 871075 871081 871084 871087 871108 871114 871120 871129 871132 871135 871159 871162 871165 871168 871171 871177 871180 871183 871192 871195 871198 871204 871210 871213 871216 871222 871225 871228 871231 871234 871240 871243 871246 871249 871252 871258 871276 871279 871282 871288 871300 871351 871357 871360 871363 871366 871369 871372 871375 871381 871384 871390 871393 871396 871399 871402 871405 871408 871411 871414 871417 871423 871426 871438 871444 871480 871483 871486 871489 871492 871495 871498 871513 871516 871534 871546 871549 871558 871585 871588 871600 871606 871678 871705 871711 872344 873997 874003 874006 874012 874021 874042 874051 874057 874069 874072 874084 874087 874093 874102 874105 874117 874294 874303 874309 874312 874318 874321 874366 874369 874381 874387 874390 874393 874396 874417 874420 874426 874435 874441 874447 874450 874453 874456 874462 874468 874477 874486 874489 874495 874498 874501 874504 874510 874513 874516 874534 874540 874543 874546 874549 874558 874567 874570 874624 874639 874642 874648 874651 874654 874660 874675 874684 874690 874693 874696 874717 874723 874729 874738 874744 874759 874867 874891 874900 874903 874906 874909 874918 874927 874930 874933 874951 874954 874957 874960 874987 874990 874993 874996 874999 875008 875011 875014 875020 875023 875026 875029 875038 875041 875047 875050 875053 875059 875089 875095 875107 875116 875122 875128 875131 875143 875149 875152 875158 875164 875167 875251 875254 875269 875278 875401 875404 875413 875416 875419 875422 875425 875443 875446 875452 875458 875464 875473 875476 875491 875500 875503 875509 875527 875536 875656 875668 875671 875674 875683 875686 875689 875692 875698 875701 875704 875707 875710 875713 875716 875722 875731 875737 875740 875764 875773 876355 876358 876370 876376 876379 876385 876951 876953 877011 877099 877115 877125 877287 877335 878283 878585 878609 878611 878629 878635 878639 879035 879041 879601 879843 879857 880221 880345 880351 880373 880385 880401 880455 880513 880523 880577 880617 880619 880651 880657 880797 880807 880821 880823 880845 880909 880911 880915 880927 880937 880941 880961 880963 880969 880975 880985 880999 881007 881015 881077 881081 881121 881131 881139 881203 881205 881207 881315 881319 881321 881335 881345 881419 881695 882087 882089 882099 882131 882143 882157 882175 882201 882207 882221 882229 882231 882243 882245 882263 882279 882307 882321 882429 882431 882433 882461 882463 882583 882587 882615 882693 882741 882811 882891 883067 883075 883085 883107 883113 883121 883123 883127 883131 883147 883149 883203 883237 883241 883243 883269 883271 883279 883287 883305 883345 883347 883391 883395 883413 883579 883601 883711 883741 883757 883813 883969 884063 884181 884251 884253 884257 884259 884297 884311 884361 884405 884407 884409 884413 884415 884597 884923 885311 885349 885539 885551 885567 885573 885609 885633 885705 885713 885731 885763 885791 885803 885839 885873 886067 886085 886137 886593 886601 887001 887113 887195 887207 887331 887423 887869 888950 889078 889600 890178 893724 893920 893966 893988 894010 894154 894174 894176 894178 894180 894184 894186 894188 894198 894204 894206 894314 894316 894320 894336 894338 894344 894346 894348 894350 894352 894354 894356 894360 894362 894364 894376 894384 894410 894422 894446 894448 894514 894518 894522 894524 894544 894546 894550 894562 894568 894572 894578 894640 894644 894710 894750 894764 895044 895046 895054 895058 895060 895064 895364 895366 895684 895686 895786 895822 895824 895834 895840 895876 895880 895896 895986 895990 895996 896012 896032 896048 896050 896052 896056 896200 896204 896208 896210 896212 896214 896218 896222 896224 896226 896230 896232 896234 896252 896412 896416 896424 896428 896430 897790 897794 897796 897798 897808 897816 897820 897822 897830 897832 897840 897848 897850 897852 897854 897856 897858 897862 897870 897930 897938 897944 897954 898058 898060 898062 898064 898066 898068 898070 898078 898082 898090 898092 898106 898116 898124 898130 898132 898258 898262 898264 898270 898276 898278 898286 898288 898300 898304 898308 898310 898316 898332 898334 898336 898338 898340 898342 898350 898352 898354 898356 898360 898364 898374 898376 898378 898380 898382 898384 898386 898388 898390 898398 898406 898408 898410 898418 898422 898424 898428 898430 898434 898436 898438 898440 898444 898450 898452 898488 898542 898546 898550 898556 898560 898562 898574 898618 898652 898676 898740 898764 898770 898778 898784 898786 898800 898808 898814 898818 898830 898852 898856 898860 898866 898868 898870 898872 898874 898876 898880 898882 898884 898888 898892 898894 898922 898924 898928 898930 898932 898970 898990 898996 898998 899002 899012 899014 899020 899046 899048 899060 899062 899064 899066 899072 899566 899568 899772 899782 899786 899806 899842 899844 899846 899924 899940 900024 900064 900068 900072 900106 900130 900136 900138 900140 900152 900164 900192 900254 900256 900286 900304 900308 900310 900322 900332 900334 900336 900338 900392 900463 900473 900475 900481 900495 900533 900535 900539 900541 900663 900919 901735 902097 902101 902211 902853 903574 903576 903752 903802 903876 904353 904894 905220 905365 906150 906179 908754 910188 910422 910494 910519 913163 913481 913564 913845 916515 917562 918483 918487 918488 918491 918492 918651 918936 918938 918969 918972 918973 918974 918982 918985 918990 919000 919001 919065 919066 919067 919068 919073 919079 919081 919082 919083 919086 919090 919095 919172 919175 919190 919204 919207 919208 919229 919235 919239 919260 919279 919293 919307 919343 919373 919399 919440 919446 919448 919465 919483 919503 919700 919710 919868 920098 920107 920268 920359 920360 920379 920524 920643 921175 921301 921302 921370 921432 921487 921637 922373 922448 922746 923055 923106 923108 923173 923230 923291 923303 923375 923585 923708 923789 923884 924136 924177 924218 924395 924743
Blocks: systemwide-clang gcc-14
  Show dependency tree
 
Reported: 2022-09-16 16:21 UTC by Sam James
Modified: 2024-02-22 12:03 UTC (History)
13 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/etc/portage/bashrc hook (file_870412.txt,2.01 KB, text/plain)
2022-09-16 16:21 UTC, Sam James
Details
emerge-info.txt (emerge-info.txt,17.61 KB, text/plain)
2022-09-17 17:19 UTC, Toralf Förster
Details
clang.tar.bz2 (clang.tar.bz2,2.58 KB, application/x-bzip)
2022-09-17 17:19 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,65.30 KB, text/plain)
2022-09-17 17:19 UTC, Toralf Förster
Details
environment (environment,75.74 KB, text/plain)
2022-09-17 17:19 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,10.33 KB, application/x-bzip)
2022-09-17 17:19 UTC, Toralf Förster
Details
logs.tar.bz2 (logs.tar.bz2,10.43 KB, application/x-bzip)
2022-09-17 17:19 UTC, Toralf Förster
Details
mail-filter:mapson-3.3.1:20220917-161113.log (mail-filter:mapson-3.3.1:20220917-161113.log,34.19 KB, text/plain)
2022-09-17 17:19 UTC, Toralf Förster
Details
temp.tar.bz2 (temp.tar.bz2,26.65 KB, application/x-bzip)
2022-09-17 17:19 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-16 16:21:13 UTC
Created attachment 805687 [details]
/etc/portage/bashrc hook

See https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213 for the background.

Clang 15 (it's been reverted in 15.0.1) turns on the following as -Werror-by-default:
* -Werror=implicit-function-declaration
* -Werror=implicit-int
* -Werror=strict-prototypes

This has led to various build failures, but also build failures or runtime problems caused by configure tests giving the wrong result!

---

I've attached a cheesy /etc/portage/bashrc hook which creates /var/tmp/clang/${CATEGORY}/${PF}/clang{14,15}.log & clang.diff which allows easy checking for "error.*implicit", etc.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-16 17:14:49 UTC
(In reply to Sam James from comment #0)
> Created attachment 805687 [details]
> /etc/portage/bashrc hook
> 
> I've attached a cheesy /etc/portage/bashrc hook which creates
> /var/tmp/clang/${CATEGORY}/${PF}/clang{14,15}.log & clang.diff which allows
> easy checking for "error.*implicit", etc.

I'm updating this at https://gist.github.com/thesamesam/4ddaa95f3f42c2be312b676476cbf505.
Comment 2 Toralf Förster gentoo-dev 2022-09-17 17:19:20 UTC Comment hidden (obsolete)
Comment 3 Toralf Förster gentoo-dev 2022-09-17 17:19:21 UTC Comment hidden (obsolete)
Comment 4 Toralf Förster gentoo-dev 2022-09-17 17:19:22 UTC Comment hidden (obsolete)
Comment 5 Toralf Förster gentoo-dev 2022-09-17 17:19:23 UTC Comment hidden (obsolete)
Comment 6 Toralf Förster gentoo-dev 2022-09-17 17:19:25 UTC Comment hidden (obsolete)
Comment 7 Toralf Förster gentoo-dev 2022-09-17 17:19:26 UTC Comment hidden (obsolete)
Comment 8 Toralf Förster gentoo-dev 2022-09-17 17:19:27 UTC Comment hidden (obsolete)
Comment 9 Toralf Förster gentoo-dev 2022-09-17 17:19:29 UTC Comment hidden (obsolete)
Comment 10 Toralf Förster gentoo-dev 2022-09-17 17:19:30 UTC Comment hidden (obsolete)
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-17 17:44:34 UTC
* Finding these bugs

This is NOT a complete list. Toralf is actively filing more, but there's two class of bugs here:

1. Explicit build failures like these (things being reported here)

2. Silent wrong configure results (see linked Discourse thread above, e.g. bug 869539) where things will compile but be wrong at runtime. To look into this, we need to diff configure before/after and look for errors with -Werror that didn't appear before. No bugs are being filed for these yet as it's harder to automate.

To help with those, run the gist linked above in /etc/portage/bashrc, and grep -rsin "error.*" /var/tmp/clang or similar. Toralf is also helping to collect data for this and we may be able to automatically file bugs for it in future, but we need to avoid noise/false positives.

--

* Reproducing these issues

mgorny is working on Clang config support to make testing this easier, but to reproduce issues, just use:
```
CC=clang CXX=clang++ CFLAGS="-O2 -Werror=implicit-function-declaration -Werror=implicit-int -Werror=strict-prototypes"
```

No need for CXXFLAGS as C++ doesn't have these issues.

--

* Fixing these issues

1. Please upstream patches wherever possible! This is going to affect every distro & it's going to affect GCC in time. Reducing duplication of work is important with the scale of the task here.

2. Almost all of these fixes require revbumps as they affect code generation. The only time you don't is when you'd get certain failure immediately with say, an ancient autoconf version, like bug 870571 -- and even then, you need to be careful to catch any others in configure & during the actual building of the package.
Comment 13 Larry the Git Cow gentoo-dev 2022-09-19 16:26:49 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dbcc188c5ef6bc63190cc07c93452652c682f5bb

commit dbcc188c5ef6bc63190cc07c93452652c682f5bb
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-09-19 16:10:24 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-09-19 16:26:41 +0000

    sys-devel/autoconf: backport K&R decls fix to 2.13
    
    Backport the K&R decls fix to 2.13 to avoid configure tests
    failing (often "silently", i.e. doesn't fail the build of
    the package overall, just leads to wrong results) with
    newer compilers like the upcoming Clang 16.
    
    A consequence of this whole fuss is that we're going to
    have to eautoreconf in a bunch of older packages, but
    as Ionen pointed out on IRC, this means we get some
    other stuff for free like Python 3.10 fixes, so it's
    not all bad.
    
    Undecided how to handle any packages with a generated
    configure from autoconfs not in tree. We may just
    patch the configure manually. Will see.
    
    See linked bug 870412 and the Discourse thread therein for
    details if unfamiliar.
    
    As I remarked on IRC, it's unfortunate to have to backport anything
    which will then infect generated configure, as it's somewhat
    a repeat of the --runstatedir situation, and it leads to confusion/hassle
    when sending patches upstream where a generated/bootstrapped configure
    is required.
    
    But this is different - it's a (serious) bug being fixed
    rather than a gratuitous (although) understandable given we weren't
    sure if we'd ever see another autoconf release backport of a new
    feature.
    
    Bug: https://bugs.gentoo.org/806376
    Bug: https://bugs.gentoo.org/870412
    Thanks-to: Arsen Arsenovic <arsen@aarsen.me>
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/autoconf/autoconf-2.13-r3.ebuild         |  51 +++
 .../files/autoconf-2.13-K-R-decls-clang.patch      | 346 +++++++++++++++++++++
 2 files changed, 397 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79c0b97504177b9ee374e3d96af8b03349b86d12

commit 79c0b97504177b9ee374e3d96af8b03349b86d12
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-09-19 16:07:54 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-09-19 16:26:40 +0000

    sys-devel/autoconf: backport K&R decls fix to 2.69
    
    Backport the K&R decls fix to 2.69 to avoid configure tests
    failing (often "silently", i.e. doesn't fail the build of
    the package overall, just leads to wrong results) with
    newer compilers like the upcoming Clang 16.
    
    A consequence of this whole fuss is that we're going to
    have to eautoreconf in a bunch of older packages, but
    as Ionen pointed out on IRC, this means we get some
    other stuff for free like Python 3.10 fixes, so it's
    not all bad.
    
    Undecided how to handle any packages with a generated
    configure from autoconfs not in tree. We may just
    patch the configure manually. Will see.
    
    See linked bug 870412 and the Discourse thread therein for
    details if unfamiliar.
    
    As I remarked on IRC, it's unfortunate to have to backport anything
    which will then infect generated configure, as it's somewhat
    a repeat of the --runstatedir situation, and it leads to confusion/hassle
    when sending patches upstream where a generated/bootstrapped configure
    is required.
    
    But this is different - it's a (serious) bug being fixed
    rather than a gratuitous (although) understandable given we weren't
    sure if we'd ever see another autoconf release backport of a new
    feature.
    
    Bug: https://bugs.gentoo.org/806376
    Bug: https://bugs.gentoo.org/870412
    Thanks-to: Arsen Arsenovic <arsen@aarsen.me>
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/autoconf/autoconf-2.69-r7.ebuild         |  63 ++++
 .../files/autoconf-2.69-K-R-decls-clang.patch      | 387 +++++++++++++++++++++
 2 files changed, 450 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0acd23de8af61e7b900c3ff2c0fcbfe0b0ddc3a3

commit 0acd23de8af61e7b900c3ff2c0fcbfe0b0ddc3a3
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-09-19 03:01:26 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-09-19 16:26:40 +0000

    sys-devel/autoconf: backport K&R decls fix to 2.71
    
    Backport the K&R decls fix to 2.71 to avoid configure tests
    failing (often "silently", i.e. doesn't fail the build of
    the package overall, just leads to wrong results) with
    newer compilers like the upcoming Clang 16.
    
    A consequence of this whole fuss is that we're going to
    have to eautoreconf in a bunch of older packages, but
    as Ionen pointed out on IRC, this means we get some
    other stuff for free like Python 3.10 fixes, so it's
    not all bad.
    
    Undecided how to handle any packages with a generated
    configure from autoconfs not in tree. We may just
    patch the configure manually. Will see.
    
    See linked bug 870412 and the Discourse thread therein for
    details if unfamiliar.
    
    Patches:
    - AC_C_BIGENDIAN-lto.patch ("Port AC_C_BIGENDIAN to cross gcc -std=c11 -flto")
    - AC_LANG_CALL_C_cxx.patch ("Port AC_LANG_CALL(C) to C++")
    - K-R-decls-clang.patch ("Port to compilers that moan about K&R func decls")
    
    The first two are included to make the latter apply cleanly, but they're
    also both harmless and desirable.
    
    As I remarked on IRC, it's unfortunate to have to backport anything
    which will then infect generated configure, as it's somewhat
    a repeat of the --runstatedir situation, and it leads to confusion/hassle
    when sending patches upstream where a generated/bootstrapped configure
    is required.
    
    But this is different - it's a (serious) bug being fixed
    rather than a gratuitous (although) understandable given we weren't
    sure if we'd ever see another autoconf release backport of a new
    feature.
    
    Backports to 2.69 & 2.13 to follow.
    
    Bug: https://bugs.gentoo.org/806376
    Bug: https://bugs.gentoo.org/870412
    Thanks-to: Arsen Arsenovic <arsen@aarsen.me>
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/autoconf/autoconf-2.71-r3.ebuild         |  87 +++++++++++++
 .../files/autoconf-2.71-AC_C_BIGENDIAN-lto.patch   |  50 ++++++++
 .../files/autoconf-2.71-AC_LANG_CALL_C_cxx.patch   |  30 +++++
 .../files/autoconf-2.71-K-R-decls-clang.patch      | 136 +++++++++++++++++++++
 4 files changed, 303 insertions(+)
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-26 02:04:49 UTC
Note that Clang 15/16 doesn't set -Werror=strict-prototypes, but rather that some configure scripts force -Werror.
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-09 21:33:07 UTC
See https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240 for latest summary and the gist of this whole thing if you're wondering what this is about.
Comment 16 Larry the Git Cow gentoo-dev 2022-11-09 01:17:54 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=85723dbd4d8fa6392001adeb8ca695a29e530949

commit 85723dbd4d8fa6392001adeb8ca695a29e530949
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-11-09 01:16:27 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-11-09 01:17:50 +0000

    bin: replace check-implicit-pointer-usage.py
    
    Always die on -Wimplicit-function-declaration as Clang 16 is going
    to make it fatal and it's always pretty dubious.
    
    The licencing of check-implicit-pointer-usage.py is also unclear,
    but the tool has been broken since GCC 4.5(!)
    
    Bug: https://bugs.gentoo.org/365655
    Bug: https://bugs.gentoo.org/870412
    Signed-off-by: Sam James <sam@gentoo.org>

 bin/check-implicit-pointer-usage.py   | 79 -----------------------------------
 bin/install-qa-check.d/90gcc-warnings | 46 ++++----------------
 2 files changed, 7 insertions(+), 118 deletions(-)
Comment 17 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-18 00:24:52 UTC
(In reply to Sam James from comment #15)
> See
> https://archives.gentoo.org/gentoo-dev/message/
> dd9f2d3082b8b6f8dfbccb0639e6e240 for latest summary and the gist of this
> whole thing if you're wondering what this is about.

And now https://wiki.gentoo.org/wiki/Modern_C_porting.
Comment 18 Larry the Git Cow gentoo-dev 2022-11-18 01:03:03 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=541ccf270b9b9b5631072a654cd3add5ccd433e7

commit 541ccf270b9b9b5631072a654cd3add5ccd433e7
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-11-18 01:01:13 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-11-18 01:02:05 +0000

    sys-devel/autoconf: backport further Clang 16 fixes (2.69)
    
    It turns out we had some of these fixes already in our 2.69 from
    previous backporting work which ended up catching stuff which wasn't actually
    applied upstream yet, so the patch change here is much smaller than for 2.71.
    
    Bug: https://bugs.gentoo.org/870412
    Signed-off-by: Sam James <sam@gentoo.org>

 ...conf-2.69-r7.ebuild => autoconf-2.69-r8.ebuild} |  0
 .../files/autoconf-2.69-K-R-decls-clang.patch      | 29 ++++++++++++++++++++++
 2 files changed, 29 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc030538dc51e0bccceea9372bfab68cda588b8c

commit cc030538dc51e0bccceea9372bfab68cda588b8c
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-11-18 00:55:29 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-11-18 01:02:04 +0000

    sys-devel/autoconf: backport further Clang 16 fixes (2.71)
    
    Bug: https://bugs.gentoo.org/870412
    Signed-off-by: Sam James <sam@gentoo.org>

 ...conf-2.71-r4.ebuild => autoconf-2.71-r5.ebuild} |  1 +
 .../files/autoconf-2.13-K-R-decls-clang.patch      |  2 +-
 .../files/autoconf-2.71-K-R-decls-clang-deux.patch | 94 ++++++++++++++++++++++
 .../files/autoconf-2.71-K-R-decls-clang.patch      |  2 +-
 4 files changed, 97 insertions(+), 2 deletions(-)
Comment 19 Larry the Git Cow gentoo-dev 2022-11-20 23:33:48 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=0fdbbbdb5a80e331adf701f2b2c1f096695447c4

commit 0fdbbbdb5a80e331adf701f2b2c1f096695447c4
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-11-20 23:32:08 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-11-20 23:33:43 +0000

    install-qa-check.d/90gcc-warnings: don't make implicit func decls fatal for now
    
    We need to do this at some point (as Clang 16 and GCC 14 are doing it, and
    they indicate runtime problems anyway), but there's too much breakage for now.
    
    We did find some extra bugs though. The main issue is too much high-profile
    stuff breaks rather than the total number of bugs, wrt Portage behaviour
    changing being suitable or not.
    
    Bug: https://bugs.gentoo.org/870412
    Signed-off-by: Sam James <sam@gentoo.org>

 NEWS                                  | 4 ++++
 bin/install-qa-check.d/90gcc-warnings | 7 ++++---
 2 files changed, 8 insertions(+), 3 deletions(-)
Comment 20 Larry the Git Cow gentoo-dev 2022-11-20 23:37:19 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d184f1a99a9bbf53b1fc0f288300ed1979099f2

commit 1d184f1a99a9bbf53b1fc0f288300ed1979099f2
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-11-20 23:36:46 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-11-20 23:37:12 +0000

    sys-apps/portage: make Portage less noisy on implicit func. decls for now
    
    We will undo this again soon, but we need fewer high profiles to be
    broken first, as it impacts wider testing & bug finding.
    
    Bug: https://bugs.gentoo.org/870412
    Signed-off-by: Sam James <sam@gentoo.org>

 ...rtage-3.0.39-implicit-func-decls-no-fatal.patch | 34 ++++++++++++++++++++++
 ...tage-3.0.39.ebuild => portage-3.0.39-r1.ebuild} |  1 +
 2 files changed, 35 insertions(+)
Comment 21 Larry the Git Cow gentoo-dev 2022-11-23 01:14:02 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cece5b154234aa8c9982feae05f67df8db39e270

commit cece5b154234aa8c9982feae05f67df8db39e270
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-11-23 01:12:30 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-11-23 01:12:30 +0000

    autotools.eclass: crank up autoconf minimum versions
    
    This ensures we have versions which have Clang 16 / GCC 14 / stricter
    compiler fixes, so 'eautoreconf' will Do The Right Thing.
    
    Closes: https://bugs.gentoo.org/870412
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/autotools.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 22 Larry the Git Cow gentoo-dev 2022-11-24 16:53:50 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20bcabbb6778de49da6d64cdab10e5a84c4497fb

commit 20bcabbb6778de49da6d64cdab10e5a84c4497fb
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2022-11-24 16:50:55 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-11-24 16:53:03 +0000

    sys-apps/less: call eautoreconf in all ebuilds
    
    This should prevent weirdness with clang-16.
    
    Bug: https://bugs.gentoo.org/870412
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-apps/less/less-608-r1.ebuild |  2 ++
 sys-apps/less/less-612.ebuild    | 11 +++++++++++
 2 files changed, 13 insertions(+)
Comment 23 Peter Levine 2022-12-09 21:54:34 UTC
Should there be a tracker for suggested last-riting?  So many of these packages have more than a 10 year lapse of activity, no reverse-deps, and too many outdated language constructs to be worth fixing.
Comment 24 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-13 19:23:28 UTC
(In reply to Peter Levine from comment #23)
> Should there be a tracker for suggested last-riting?  So many of these
> packages have more than a 10 year lapse of activity, no reverse-deps, and
> too many outdated language constructs to be worth fixing.

I'd say CC treecleaner@ on them, with a brief comment explaining why you think it should go. Then periodically, we'll go through and look for bugs blocking this tracker with treecleaner CC'd.
Comment 25 Larry the Git Cow gentoo-dev 2023-02-23 23:36:25 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c1172d2e454c89f3bbda6841e06b8230a399d49

commit 9c1172d2e454c89f3bbda6841e06b8230a399d49
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2023-02-23 22:43:58 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2023-02-23 23:33:20 +0000

    mail-filter/opendkim: fix two musl/standards issues.
    
    New patches to fix a missing include and to correct a few function
    signatures that violated the C standards.
    
    Closes: https://bugs.gentoo.org/870412
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 .../opendkim/files/opendkim-2.10.3-c-std.patch     | 155 +++++++++++++++++++++
 .../files/opendkim-2.10.3-snprintf-include.patch   |  27 ++++
 mail-filter/opendkim/opendkim-2.10.3-r30.ebuild    |   2 +
 3 files changed, 184 insertions(+)
Comment 26 Larry the Git Cow gentoo-dev 2023-02-28 19:11:08 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=830c46baf116bf8fca5b981723122ece4bfcbcd9

commit 830c46baf116bf8fca5b981723122ece4bfcbcd9
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-02-28 18:31:14 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-02-28 19:10:36 +0000

    profiles/base: add cache vars for -Wimplicit-function-declaration silencing
    
    Autoconf has a builtin check to try figure out how to make the compiler
    error out on implicit function declarations. This check necessarily emits
    such a warning/error. We know that -Werror=implicit-function-declaration
    will work on any compiler we care about, so just force that to avoid noise.
    
    This means we don't have to try whitelist 'strchr'.
    
    Bug: https://bugs.gentoo.org/870412
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/base/make.defaults | 6 ++++++
 1 file changed, 6 insertions(+)
Comment 27 Philippe Chaintreuil 2023-03-17 13:51:10 UTC Comment hidden (obsolete)
Comment 28 Philippe Chaintreuil 2023-03-17 13:55:17 UTC Comment hidden (obsolete)
Comment 29 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-19 01:10:26 UTC
If you're landing on this bug and you have no idea what's going on, please see the detailed summary, FAQ, etc at https://wiki.gentoo.org/wiki/Modern_C_porting. Thanks!
Comment 30 Larry the Git Cow gentoo-dev 2023-12-06 05:42:05 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92d6b34449e631c904cc0c30c7d99853647c3ea2

commit 92d6b34449e631c904cc0c30c7d99853647c3ea2
Author:     Eli Schwartz <eschwartz93@gmail.com>
AuthorDate: 2023-12-06 04:40:13 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-12-06 05:41:01 +0000

    dev-util/meson: backport patch to stop hiding vala compiler warnings
    
    This is especially bad because it makes these packages disappear
    entirely from QA checks for, say, Modern C. Although it's only a matter
    of adding more warnings, and doesn't really affect the resulting
    packages, we need this live in order to do proper QA.
    
    Bug: https://bugs.gentoo.org/870412
    Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/34141
    Signed-off-by: Sam James <sam@gentoo.org>

 ...nd-don-t-hide-all-compiler-warnings-for-t.patch | 250 +++++++++++++++++++++
 dev-util/meson/meson-1.3.0-r2.ebuild               | 135 +++++++++++
 2 files changed, 385 insertions(+)