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
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: 509696 716192 729526 741080 757675 815109 829166 830497 836784 855662 870430 870490 870541 870550 870568 870574 870643 870778 870787 870793 870955 870982 871039 871123 871207 871261 871267 871288 871303 871429 871441 871453 871459 871477 871504 871531 871594 871699 871702 873631 874015 874090 874291 874423 874429 874438 874441 874483 874507 874531 874585 874645 874669 874687 874699 874720 874741 874921 874963 875005 875032 875062 875098 875155 875170 875236 875242 875263 875275 875431 875434 875437 875470 875479 875482 875485 875494 875497 875512 875659 875662 875665 875680 875719 875734 876337 876346 877109 877121 878615 878623 878641 880341 880419 880603 880799 880819 880827 880843 880901 880905 880913 880917 880935 880943 880949 880953 880959 880965 880971 880983 880987 881017 881069 881071 881079 881087 881143 881213 881215 881245 881311 881347 881421 882029 882113 882241 882345 882581 882585 882657 882659 882927 883101 883125 883205 883267 883275 883421 883463 883581 883663 883703 883705 883707 883747 883891 884015 884331 884663 884709 884779 884823 884829 884917 884925 885043 885059 885061 885063 885095 885417 885467 885533 885599 885623 885769 885841 885869 885871 885877 885961 886065 886139 886169 886457 886461 886463 886464 886466 886597 886609 887123 887249 887415 887457 887623 887641 887643 887645 887647 887865 894196 894318 894322 894324 894372 894382 894508 894552 894554 894574 894712 894714 895030 895036 895184 895360 895838 895842 895848 895882 895988 896418 896426 897800 897818 897834 897840 897842 897844 897946 898072 898088 898094 898174 898272 898280 898282 898290 898294 898302 898538 898540 898554 898564 898614 900398 907421 913559 913572 918971 918995 918998 919021 919058 919067 919087 919163 919167 919169 919176 919177 919178 919181 919185 919187 919194 919195 919197 919199 919203 919209 919213 919214 919215 919216 919218 919219 919220 919221 919222 919224 919226 919227 919231 919233 919237 919250 919251 919252 919254 919257 919259 919261 919262 919270 919286 919295 919300 919301 919348 919358 919360 919361 919363 919367 919369 919370 919371 919388 919389 919390 919392 919402 919409 919421 919443 919459 919460 919471 919493 919502 919578 919874 919876 919877 920156 920193 920275 920312 920316 920323 920324 920356 920362 920369 920450 920451 920452 920453 920478 920521 920522 920533 920640 920768 920772 920774 920776 920810 920830 920880 920915 920916 920917 920918 921020 921024 921025 921028 921029 921030 921031 921087 921110 921126 921136 921185 921186 921353 921364 921384 921489 921571 921572 921573 921601 922434 922489 922621 922624 922687 922718 923042 923125 923170 923406 923635 923914 923937 923938 924163 924210 924316 924487 924488 924510 924712 924761 924928 924969 925077 925143 925229 925418 925558 925587 925593 925709 925853 926310 926464 926465 926468 926469 926515 927077 927172 927212 927215 927253 927336 927337 927383 927410 927411 927550 927671 927679 927680 927681 927684 927794 927866 927867 927868 927869 927905 927945 928094 928096 928314 928315 928454 928565 929253 929254 930009 930028 930101 930338 930439 930472 930509 930654 930713 930717 931100 931855 931876 931906 931952 932005 932230 932280 932436 932440 932441 932456 932509 932534 932536 932841 933101 933351 933360 933742 933773 934056 934059 934063 934114 934131 934208 934407 934422 934654 934814 934815 934887 934888 934979 934985 935067 935230 935559 935625 935659 936060 936118 936136 936147 936285 936516 936556 936565 936672 936814 936825 936938 936953 937091 937093 937096 937097 937134 937135 937273 937323 937325 937374 937432 937434 937435 938087 938249 938322 938324 938566 938581 939000 939135 939164 939219 939503 939582 939693 940038 940221 940497 940594 940597 940612 940693 941085 941132 941402 941417 941424 941447 941491 941540 941542 941555 941760 941853 941941 941973 942063 942210 942215 942296 942319 942365 942412 942415 942425 942436 942506 942550 942788 942789 942866 942905 942981 943014 943718 943929 943935 943937 943941 943949 944033 944034 944035 944036 944043 944110 944163 944166 944177 944194 944196 944197 944200 602656 618302 628744 647358 661334 705800 712534 713662 714652 729820 730802 731180 734088 738850 739154 740224 744328 748522 769557 776667 784092 813870 822261 829633 830222 831176 831387 831491 831519 832016 832666 834369 839648 849515 853721 855554 855953 860441 867655 869149 869203 869242 869254 869299 869371 869380 869404 869539 869884 869980 869995 870004 870007 870043 870415 870418 870424 870427 870433 870436 870445 870448 870451 870457 870463 870466 870472 870475 870478 870481 870484 870487 870493 870499 870502 870514 870517 870520 870523 870526 870535 870538 870544 870547 870553 870559 870565 870571 870625 870631 870634 870637 870640 870646 870649 870652 870655 870661 870664 870667 870670 870673 870676 870679 870682 870685 870703 870706 870709 870712 870718 870721 870724 870727 870730 870733 870736 870739 870742 870745 870748 870751 870763 870769 870772 870775 870781 870784 870790 870796 870799 870802 870805 870808 870811 870817 870820 870829 870832 870835 870838 870841 870844 870847 870850 870853 870856 870859 870862 870865 870868 870871 870883 870886 870889 870892 870895 870898 870901 870904 870907 870910 870916 870919 870925 870928 870940 870943 870946 870949 870952 870958 870961 870964 870970 870973 870979 870988 870991 870997 871000 871003 871009 871012 871015 871024 871027 871030 871036 871042 871045 871048 871051 871054 871057 871060 871063 871066 871069 871072 871075 871078 871081 871084 871087 871093 871096 871102 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 871294 871300 871351 871357 871360 871363 871366 871369 871372 871375 871378 871381 871384 871387 871390 871393 871396 871399 871402 871405 871408 871411 871414 871417 871420 871423 871426 871438 871444 871450 871456 871468 871480 871483 871486 871489 871492 871495 871498 871507 871513 871516 871519 871534 871537 871543 871546 871549 871558 871567 871585 871588 871597 871600 871603 871606 871678 871705 871711 873619 873997 874003 874006 874012 874018 874021 874042 874057 874069 874072 874081 874084 874087 874093 874102 874105 874114 874117 874294 874303 874309 874312 874315 874318 874321 874366 874369 874381 874384 874387 874390 874393 874396 874402 874414 874417 874420 874426 874432 874435 874447 874450 874453 874456 874462 874468 874477 874486 874489 874495 874498 874501 874504 874510 874513 874516 874519 874534 874540 874543 874546 874549 874558 874561 874567 874570 874582 874621 874624 874639 874642 874648 874651 874654 874660 874675 874684 874690 874693 874696 874702 874717 874723 874729 874732 874738 874744 874753 874759 874867 874891 874894 874900 874903 874906 874909 874918 874927 874930 874933 874936 874951 874954 874957 874960 874966 874969 874972 874987 874990 874993 874996 874999 875008 875011 875014 875020 875023 875026 875029 875035 875038 875041 875044 875047 875050 875053 875056 875059 875065 875086 875089 875092 875095 875107 875116 875119 875122 875128 875131 875143 875149 875152 875158 875164 875167 875233 875239 875245 875251 875254 875266 875269 875272 875278 875281 875401 875404 875410 875413 875416 875419 875422 875425 875428 875443 875446 875452 875458 875464 875467 875473 875476 875491 875500 875503 875506 875509 875527 875530 875533 875536 875656 875668 875671 875674 875683 875686 875689 875692 875698 875701 875704 875707 875710 875713 875716 875722 875731 875737 875740 875746 875749 875764 875767 875770 875773 876355 876358 876370 876376 876379 876385 876945 876951 876953 877011 877099 877105 877115 877125 877287 877295 877335 878283 878585 878609 878611 878613 878617 878627 878629 878635 878639 879033 879035 879041 879601 879843 879857 879873 880221 880343 880345 880351 880365 880373 880375 880385 880401 880411 880413 880429 880451 880455 880513 880523 880577 880617 880619 880651 880657 880797 880807 880809 880811 880821 880823 880833 880839 880845 880907 880909 880911 880915 880925 880927 880931 880937 880941 880955 880961 880963 880969 880975 880985 880997 880999 881007 881011 881015 881077 881081 881121 881131 881139 881203 881205 881207 881209 881307 881315 881319 881321 881323 881335 881345 881419 881695 882087 882089 882099 882121 882131 882143 882157 882175 882183 882197 882201 882207 882221 882223 882225 882229 882231 882243 882245 882263 882265 882271 882279 882283 882303 882307 882315 882321 882429 882431 882433 882461 882463 882583 882587 882607 882615 882693 882713 882741 882805 882811 882891 883069 883075 883085 883095 883099 883107 883111 883113 883117 883121 883123 883127 883131 883147 883149 883203 883207 883237 883241 883243 883265 883269 883271 883279 883287 883299 883305 883345 883347 883391 883393 883395 883413 883423 883579 883587 883601 883603 883661 883709 883711 883741 883757 883813 883969 884043 884063 884181 884249 884251 884253 884257 884259 884283 884297 884303 884311 884345 884361 884405 884407 884409 884411 884413 884415 884597 884743 884883 884923 885057 885311 885349 885475 885523 885527 885531 885539 885551 885563 885567 885573 885609 885611 885633 885697 885699 885705 885711 885713 885731 885761 885763 885785 885791 885803 885839 885873 885885 885963 885965 886067 886085 886105 886127 886137 886455 886460 886465 886593 886601 886603 887001 887113 887119 887187 887195 887207 887209 887331 887333 887423 887445 887625 887637 887713 887869 887877 887879 887999 888003 888023 888950 889078 889600 890178 892708 893724 893920 893958 893966 893988 894010 894176 894188 894198 894204 894316 894320 894328 894334 894336 894338 894344 894348 894352 894354 894356 894360 894364 894376 894410 894422 894448 894514 894518 894522 894544 894546 894550 894560 894562 894572 894716 894750 894774 894794 895028 895044 895046 895050 895052 895058 895060 895062 895064 895182 895364 895366 895684 895686 895786 895822 895824 895832 895834 895840 895846 895884 895886 895888 895894 895986 895990 896004 896012 896032 896048 896050 896052 896056 896200 896204 896210 896212 896214 896218 896222 896224 896230 896232 896412 896424 897820 897822 897830 897832 897836 897848 897850 897852 897854 897856 897858 897862 897866 897870 897930 897938 897944 897954 897956 898058 898060 898062 898064 898066 898078 898080 898082 898090 898092 898102 898106 898258 898262 898264 898270 898278 898288 898298 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 898550 898552 898556 898560 898562 898616 898618 898652 898676 898740 898764 898770 898778 898784 898786 898800 898808 898814 898818 898830 898852 898854 898856 898860 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 903552 903576 903752 903802 903876 904353 904894 905220 905365 906150 906179 909563 910188 910422 910494 910519 910521 911821 913163 913481 913564 913845 915040 916515 917562 918483 918487 918488 918491 918492 918600 918650 918651 918912 918936 918938 918941 918969 918972 918973 918974 918982 918983 918985 918988 918990 918999 919000 919001 919024 919065 919066 919068 919069 919073 919076 919077 919078 919079 919080 919081 919082 919083 919084 919085 919086 919088 919089 919090 919091 919092 919093 919094 919095 919121 919162 919172 919175 919179 919180 919182 919183 919184 919188 919189 919190 919192 919193 919196 919198 919200 919204 919205 919207 919208 919210 919211 919212 919223 919225 919228 919229 919235 919238 919239 919249 919256 919258 919260 919266 919269 919277 919279 919280 919282 919288 919293 919294 919296 919304 919307 919323 919343 919362 919366 919372 919373 919375 919387 919391 919393 919399 919408 919413 919426 919440 919442 919446 919448 919458 919465 919466 919483 919489 919501 919503 919685 919700 919710 919758 919868 919875 919885 920060 920061 920062 920098 920107 920109 920231 920268 920309 920315 920359 920360 920365 920379 920380 920454 920460 920523 920524 920639 920641 920642 920643 920769 920770 920775 920936 921021 921027 921103 921135 921137 921144 921145 921166 921175 921252 921254 921255 921256 921257 921258 921261 921301 921302 921351 921370 921385 921432 921487 921523 921570 921637 921727 921840 922345 922373 922448 922572 922613 922622 922630 922633 922688 922746 922951 923021 923055 923106 923107 923108 923113 923173 923230 923291 923303 923325 923375 923408 923582 923585 923628 923636 923703 923708 923789 923884 924053 924136 924177 924209 924211 924218 924227 924395 924424 924429 924486 924673 924743 924762 924859 924861 924887 924997 925011 925012 925090 925102 925144 925146 925169 925198 925227 925252 925274 925439 925440 925497 925588 925590 925712 925876 926050 926073 926085 926129 926145 926167 926193 926207 926261 926323 926331 926467 926516 926544 926638 926650 926724 926995 927076 927187 927191 927341 927451 927453 927456 927539 927683 927712 927731 927732 927733 927734 927783 927838 927898 927899 927942 927954 928049 928301 928303 928306 928313 928358 928489 928491 928492 928511 928533 928566 928590 928621 928675 928898 928920 928942 928946 928954 928975 928980 928983 929019 929077 929189 930149 930362 930363 930501 930715 930767 931632 931661 932077 932234 932341 932352 932385 932407 932443 932460 932617 932715 932805 933073 933080 933086 933089 933130 933135 933169 933214 933356 933391 933485 933498 933511 933598 933602 933779 933841 934000 934121 934122 934410 934419 934420 934595 934890 935025 935241 935281 935353 935377 935389 935490 935544 935662 935812 935917 936080 936092 936116 936163 936394 936433 936591 936747 936845 936925 936926 937095 937100 937245 937330 937333 937393 937561 937626 937871 938083 938613 938756 938874 939034 939347 939544 939759 939873 940541 940588 941455 941463 941641 942207 942283 942293 942416 942467 942793 943669 944158 944164 944186
Blocks: systemwide-clang gcc-14
  Show dependency tree
 
Reported: 2022-09-16 16:21 UTC by Sam James
Modified: 2024-11-20 19:08 UTC (History)
16 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(+)
Comment 31 Larry the Git Cow gentoo-dev 2024-05-19 13:58:06 UTC
The bug has been referenced in the following commit(s):

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

commit 97798026f33f4983f8d5cdf7d901d96d41b7066a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-05-19 13:45:22 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-19 13:51:38 +0000

    sys-devel/gcc: keyword 14.1.1_p20240518
    
    I think we've reached as far as we can in terms of progress with it
    masked/unkeyworded, especially given we've been working on this for
    2+ years now in preparation (Clang had essentially - but not quite -
    the same set of changes).
    
    It's also in the latest Fedora release and Arch have unleashed it as well,
    which means it's propagated into people's CI by now which should help.
    
    Bug: https://bugs.gentoo.org/870412
    Bug: https://bugs.gentoo.org/906027
    Bug: https://bugs.gentoo.org/914580
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/gcc-14.1.1_p20240518.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 32 Andreas K. Hüttel archtester gentoo-dev 2024-11-01 17:13:12 UTC
All blockers reviewed for gcc-14-stable