Bug 1220571 (modern_C)

Summary: [META] Packages failing because GCC 14+ treats some warnings as errors
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Jambor <mjambor>
Component: OtherAssignee: Martin Jambor <mjambor>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
See Also: https://bugzilla.opensuse.org/show_bug.cgi?id=1220574
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on: 1220490, 1220973, 1221006, 1221026, 1221306, 1221480, 1221682, 1221683, 1221684, 1221685, 1221690, 1221695, 1221696, 1221700, 1221704, 1221708, 1221714, 1221715, 1222377, 1223910, 1224007, 1224536, 1225772, 1225776, 1225777, 1225792, 1225794, 1225795, 1225800, 1225801, 1225862, 1225864, 1225871, 1225909, 1225916, 1225918, 1225919, 1225920, 1225921, 1225922, 1225923, 1225925, 1225927, 1225928, 1225948, 1225950, 1225951, 1225952, 1225956, 1225958, 1225959, 1225992, 1227581, 1227856, 1228121, 1220467, 1220470, 1220476, 1220481, 1220491, 1220564, 1220970, 1220975, 1220977, 1221008, 1221011, 1221013, 1221014, 1221016, 1221017, 1221025, 1221028, 1221304, 1221308, 1221687, 1221689, 1221691, 1221698, 1221701, 1221703, 1221705, 1221707, 1221709, 1221710, 1221712, 1221716, 1221863, 1222637, 1223892, 1223909, 1223978, 1224002, 1224533, 1224897, 1225755, 1225778, 1225793, 1225796, 1225852, 1225854, 1225855, 1225858, 1225859, 1225869, 1225904, 1225907, 1225908, 1225910, 1225926, 1225929, 1225931, 1225935, 1225944, 1225947, 1225953, 1225957    
Bug Blocks: 1223886    

Description Martin Jambor 2024-02-28 14:42:43 UTC
GCC 14 treats the following situations, which were only warnings
before, as errors:
  -Werror=implicit-int
  -Werror=implicit-function-declaration
  -Werror=declaration-missing-parameter-type
  -Werror=return-mismatch
  -Werror=int-conversion
  -Werror=incompatible-pointer-types

More details about all of these cases together with the most common
ways of addressing them and some associated pitfalls is available at
https://gcc.gnu.org/gcc-14/porting_to.html

For the record, clang has taken a similar step since clang 16, see
for example https://www.redhat.com/en/blog/new-warnings-and-errors-clang-16

The preferred method of dealing with these issues is of course fixing
the code.  Other distributions have shared patches from their porting
efforts on relevant upstream mailing lists and bug trackers, Gentoo
and RedHat are perhaps most active in this regard, so you can have a
look at what they did for their packages at:
  - https://bugs.gentoo.org/showdependencytree.cgi?id=870412&hide_resolved=0
  - https://gitlab.com/fweimer-rh/fedora-modernc/

In case there is for some reason not possible to fix the code, or at
least to fix it in time for adoption of GCC 14, it is possible to turn
these back to warnings by adding to the compiler options one of the
following:
  -std=gnu89,
  -std=c89, or
  -fpermissive.

(Especially if you use -fpermissive as a temporary workaround with
intention to fix the underlying issues later, I'd suggest leaving the
particular bug opened until it is done so.)
Comment 1 Martin Jambor 2024-02-28 15:26:14 UTC
The meta bug for failures with GCC 14 that are not because a warning became an error by default is bug#1220574.