Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 870412 (c99-porting)

Summary: [Tracker] Modern C (C99) porting (default -Werror=implicit-function-declaration,implicit-int,int-conversion,incompatible-pointer-types)
Product: Gentoo Linux Reporter: Sam James <sam>
Component: Current packagesAssignee: Gentoo Quality Assurance Team <qa>
Status: CONFIRMED ---    
Severity: normal CC: admnd, arkamar, arsen, bertrand, brahmajit.xyz, csfore, gentoo.qxrin, kangie, marc_heimann, pageexec, perfect007gentleman, srcshelton, voron1
Priority: Normal Keywords: PullRequest, Tracker
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://wiki.gentoo.org/wiki/Modern_C_porting
See Also: https://github.com/gentoo/gentoo/pull/27345
https://github.com/gentoo/gentoo/pull/27718
https://bugs.gentoo.org/show_bug.cgi?id=880545
https://bugs.gentoo.org/show_bug.cgi?id=365655
https://bugs.gentoo.org/show_bug.cgi?id=892651
https://bugs.gentoo.org/show_bug.cgi?id=906027
https://github.com/gentoo/gentoo/pull/34141
Whiteboard: Summary, help, and lots of details at https://wiki.gentoo.org/wiki/Modern_C_porting.
Package list:
Runtime testing required: ---
Bug Depends on: 602656, 716192, 729526, 731180, 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, 870820, 870835, 870859, 870892, 870952, 870955, 870970, 870982, 871012, 871024, 871033, 871039, 871078, 871093, 871096, 871102, 871123, 871186, 871207, 871261, 871267, 871294, 871303, 871354, 871378, 871387, 871429, 871435, 871441, 871447, 871450, 871453, 871456, 871459, 871468, 871477, 871504, 871519, 871531, 871537, 871543, 871567, 871594, 871603, 871699, 871702, 871933, 873631, 874015, 874018, 874054, 874090, 874096, 874114, 874291, 874378, 874384, 874402, 874423, 874429, 874432, 874438, 874444, 874483, 874507, 874519, 874525, 874531, 874552, 874561, 874564, 874579, 874582, 874585, 874669, 874687, 874699, 874702, 874708, 874720, 874732, 874741, 874753, 874894, 874921, 874936, 874963, 874966, 874969, 874972, 875002, 875005, 875032, 875044, 875056, 875062, 875065, 875086, 875092, 875098, 875101, 875119, 875146, 875155, 875233, 875236, 875239, 875242, 875245, 875263, 875272, 875275, 875281, 875428, 875431, 875434, 875437, 875467, 875470, 875479, 875482, 875485, 875494, 875497, 875506, 875512, 875530, 875533, 875659, 875662, 875665, 875680, 875719, 875725, 875734, 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, 880451, 880491, 880603, 880655, 880799, 880809, 880811, 880819, 880827, 880835, 880839, 880843, 880901, 880905, 880907, 880913, 880917, 880925, 880931, 880935, 880943, 880949, 880953, 880955, 880959, 880965, 880971, 880983, 880987, 881011, 881017, 881069, 881071, 881079, 881087, 881143, 881209, 881213, 881215, 881243, 881245, 881307, 881311, 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, 883101, 883117, 883125, 883205, 883207, 883211, 883265, 883267, 883281, 883299, 883421, 883423, 883463, 883581, 883603, 883661, 883663, 883703, 883705, 883707, 883747, 883891, 884015, 884043, 884303, 884331, 884411, 884663, 884709, 884743, 884779, 884823, 884829, 884883, 884917, 884925, 885043, 885059, 885061, 885063, 885095, 885417, 885467, 885475, 885523, 885531, 885533, 885599, 885611, 885623, 885697, 885699, 885711, 885761, 885769, 885785, 885841, 885869, 885871, 885877, 885885, 885961, 885965, 886065, 886127, 886139, 886169, 886455, 886457, 886461, 886463, 886464, 886466, 886597, 886603, 886609, 887119, 887123, 887187, 887249, 887415, 887457, 887623, 887625, 887641, 887643, 887645, 887647, 887865, 887877, 889555, 891297, 891533, 892708, 894196, 894318, 894322, 894324, 894328, 894334, 894370, 894372, 894382, 894508, 894552, 894554, 894560, 894574, 894712, 894714, 894716, 894774, 895028, 895030, 895036, 895050, 895184, 895360, 895516, 895838, 895842, 895846, 895848, 895882, 895884, 895886, 895888, 895894, 895988, 896004, 896418, 896426, 897800, 897818, 897834, 897836, 897842, 897844, 897866, 897946, 897956, 898072, 898080, 898088, 898094, 898102, 898174, 898272, 898280, 898282, 898290, 898294, 898298, 898302, 898538, 898540, 898552, 898554, 898564, 898614, 898616, 898854, 900398, 902851, 903552, 903573, 907421, 909563, 910521, 911821, 913559, 918599, 918600, 918601, 918602, 918650, 918912, 918941, 918971, 918983, 918988, 918995, 918998, 918999, 919021, 919058, 919077, 919078, 919080, 919087, 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, 919212, 919213, 919214, 919215, 919216, 919218, 919219, 919220, 919221, 919222, 919223, 919224, 919226, 919227, 919231, 919233, 919237, 919238, 919249, 919250, 919251, 919252, 919254, 919256, 919257, 919258, 919259, 919261, 919262, 919269, 919270, 919277, 919280, 919286, 919287, 919288, 919294, 919295, 919296, 919300, 919301, 919304, 919323, 919348, 919358, 919360, 919361, 919362, 919363, 919365, 919367, 919368, 919369, 919370, 919371, 919372, 919387, 919388, 919389, 919390, 919391, 919392, 919393, 919402, 919408, 919409, 919421, 919426, 919442, 919443, 919458, 919459, 919460, 919471, 919489, 919493, 919502, 919578, 919685, 919874, 919875, 919876, 919877, 919885, 920061, 920062, 920109, 920156, 920193, 920231, 920275, 920312, 920315, 920316, 920323, 920324, 920356, 920362, 920365, 920369, 920380, 920450, 920451, 920452, 920453, 920459, 920460, 920478, 920521, 920522, 920523, 920533, 920639, 920640, 920641, 920642, 920768, 920769, 920770, 920772, 920773, 920774, 920776, 920810, 920830, 920880, 920916, 920917, 920918, 920936, 921020, 921021, 921024, 921025, 921027, 921028, 921029, 921030, 921031, 921087, 921103, 921110, 921126, 921136, 921137, 921144, 921166, 921185, 921186, 921255, 921256, 921257, 921258, 921261, 921351, 921353, 921364, 921384, 921385, 921488, 921489, 921523, 921570, 921571, 921572, 921573, 921601, 921727, 921840, 922434, 922489, 922572, 922613, 922621, 922622, 922624, 922633, 922687, 922688, 922718, 923021, 923042, 923107, 923113, 923125, 923170, 923325, 923406, 923635, 923636, 923914, 923937, 923938, 924163, 924209, 924210, 924211, 924316, 924401, 924424, 924429, 924487, 924488, 924510, 924673, 924712, 924761, 924762, 924928, 924969, 924997, 925012, 925077, 925090, 925102, 925143, 925144, 925199, 925229, 925274, 925418, 925439, 925497, 925558, 925587, 925588, 925590, 925593, 925708, 925709, 925853, 925876, 926085, 926167, 926193, 926207, 926310, 926331, 926464, 926465, 926467, 926468, 926469, 926515, 926516, 926544, 926650, 926995, 927076, 927077, 927172, 927187, 927191, 927212, 927215, 927253, 927336, 927337, 927341, 927410, 927411, 927451, 927453, 927456, 927550, 927671, 927679, 927680, 927681, 927684, 927731, 927733, 927734, 927783, 927794, 927866, 927867, 927868, 927869, 927898, 927899, 927905, 927945, 927954, 928049, 928094, 928096, 928301, 928306, 928313, 928314, 928315, 928358, 928454, 928489, 928491, 928492, 928511, 928533, 928565, 928566, 928590, 928892, 928898, 928920, 928942, 928946, 928954, 929069, 929077, 929189, 929253, 929254, 930009, 930028, 930101, 930149, 930338, 930362, 930363, 930439, 930472, 930501, 930509, 930543, 930654, 930713, 930715, 930717, 618302, 628744, 647358, 661334, 705800, 712534, 713662, 714652, 729820, 740224, 744328, 748522, 784092, 813870, 822261, 829633, 832666, 834369, 839648, 849515, 853721, 855554, 855953, 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, 870802, 870805, 870808, 870811, 870817, 870829, 870832, 870838, 870841, 870844, 870847, 870850, 870853, 870856, 870862, 870865, 870868, 870871, 870883, 870886, 870889, 870895, 870898, 870901, 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, 871420, 871423, 871426, 871438, 871444, 871480, 871483, 871486, 871489, 871492, 871495, 871498, 871507, 871513, 871516, 871534, 871546, 871549, 871558, 871585, 871588, 871597, 871600, 871606, 871678, 871705, 871711, 872344, 873619, 873997, 874003, 874006, 874012, 874021, 874042, 874051, 874057, 874069, 874072, 874081, 874084, 874087, 874093, 874102, 874105, 874117, 874294, 874303, 874309, 874312, 874315, 874318, 874321, 874366, 874369, 874381, 874387, 874390, 874393, 874396, 874414, 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, 874621, 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, 875035, 875038, 875041, 875047, 875050, 875053, 875059, 875089, 875095, 875107, 875116, 875122, 875128, 875131, 875143, 875149, 875152, 875158, 875164, 875167, 875251, 875254, 875266, 875269, 875278, 875401, 875404, 875410, 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, 875749, 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, 880429, 880455, 880513, 880523, 880577, 880617, 880619, 880651, 880657, 880797, 880807, 880821, 880823, 880833, 880845, 880909, 880911, 880915, 880927, 880937, 880941, 880961, 880963, 880969, 880975, 880985, 880997, 880999, 881007, 881015, 881077, 881081, 881121, 881131, 881139, 881203, 881205, 881207, 881315, 881319, 881321, 881323, 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, 883075, 883085, 883099, 883107, 883111, 883113, 883121, 883123, 883127, 883131, 883147, 883149, 883203, 883237, 883241, 883243, 883269, 883271, 883279, 883287, 883305, 883345, 883347, 883391, 883393, 883395, 883413, 883579, 883587, 883601, 883709, 883711, 883741, 883757, 883813, 883969, 884063, 884181, 884249, 884251, 884253, 884257, 884259, 884283, 884297, 884311, 884345, 884361, 884405, 884407, 884409, 884413, 884415, 884597, 884923, 885057, 885311, 885349, 885527, 885539, 885551, 885563, 885567, 885573, 885609, 885633, 885705, 885713, 885731, 885763, 885791, 885803, 885839, 885873, 885963, 886067, 886085, 886105, 886137, 886460, 886465, 886593, 886601, 887001, 887113, 887195, 887207, 887209, 887331, 887333, 887423, 887445, 887637, 887713, 887869, 887879, 887999, 888003, 888023, 888950, 889078, 889600, 890178, 893724, 893920, 893958, 893966, 893988, 894010, 894174, 894176, 894188, 894198, 894204, 894316, 894320, 894336, 894338, 894344, 894346, 894348, 894352, 894354, 894356, 894360, 894364, 894376, 894410, 894422, 894448, 894514, 894518, 894522, 894544, 894546, 894550, 894562, 894572, 894750, 894794, 895044, 895046, 895052, 895058, 895060, 895062, 895064, 895182, 895364, 895366, 895684, 895686, 895786, 895822, 895824, 895832, 895834, 895840, 895986, 895990, 896012, 896032, 896048, 896050, 896052, 896056, 896200, 896204, 896210, 896212, 896214, 896218, 896222, 896224, 896230, 896232, 896412, 896424, 897820, 897822, 897830, 897832, 897840, 897848, 897850, 897852, 897854, 897856, 897858, 897862, 897870, 897930, 897938, 897944, 897954, 898058, 898060, 898062, 898064, 898066, 898078, 898082, 898090, 898092, 898106, 898258, 898262, 898264, 898270, 898278, 898288, 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, 898556, 898560, 898562, 898618, 898652, 898676, 898740, 898764, 898770, 898778, 898784, 898786, 898800, 898808, 898814, 898818, 898830, 898852, 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, 903574, 903576, 903752, 903802, 903876, 904353, 904894, 905220, 905365, 906150, 906179, 908754, 910188, 910422, 910494, 910519, 913163, 913481, 913564, 913845, 915040, 916515, 917562, 918483, 918487, 918488, 918491, 918492, 918651, 918936, 918938, 918969, 918972, 918973, 918974, 918982, 918985, 918990, 919000, 919001, 919065, 919066, 919067, 919068, 919069, 919073, 919076, 919079, 919081, 919082, 919083, 919084, 919085, 919086, 919088, 919090, 919095, 919172, 919175, 919190, 919204, 919207, 919208, 919211, 919225, 919228, 919229, 919235, 919239, 919260, 919266, 919279, 919282, 919293, 919307, 919343, 919366, 919373, 919375, 919399, 919413, 919440, 919446, 919448, 919465, 919483, 919501, 919503, 919700, 919710, 919758, 919868, 920060, 920098, 920107, 920268, 920359, 920360, 920379, 920454, 920524, 920643, 920775, 921135, 921145, 921175, 921252, 921254, 921301, 921302, 921370, 921432, 921487, 921637, 922345, 922373, 922448, 922630, 922746, 922951, 923055, 923106, 923108, 923173, 923230, 923291, 923303, 923375, 923582, 923585, 923628, 923703, 923708, 923789, 923884, 924053, 924136, 924177, 924218, 924227, 924395, 924486, 924743, 924859, 924861, 924887, 925011, 925146, 925169, 925198, 925227, 925252, 925440, 925712, 926050, 926073, 926129, 926145, 926261, 926323, 926638, 926724, 927539, 927683, 927712, 927732, 927838, 927942, 928303, 928621, 928675, 928975, 928980, 928983, 929019    
Bug Blocks: 408963, 914580    
Attachments: /etc/portage/bashrc hook
emerge-info.txt
clang.tar.bz2
emerge-history.txt
environment
etc.portage.tar.bz2
logs.tar.bz2
mail-filter:mapson-3.3.1:20220917-161113.log
temp.tar.bz2

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(+)