From Fedora Project Wiki

Porting Fedora to Modern C

Important.png
This is a proposed Change for Fedora Linux.
This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee.

Summary

Back in 1999, a new revision of the C standard removed several backwards compatibility features. However, GCC still accepts these obsolete constructs by default. Support for these constructs is confusing to programmers and potentially affect GCC's ability to implement features from future C standards.

Owner


Current status

  • Targeted release: Fedora Linux 40
  • Last updated: 2022-10-25
  • FESCo issue: <will be assigned by the Wrangler>
  • Tracker bug: <will be assigned by the Wrangler>
  • Release notes tracker: <will be assigned by the Wrangler>

Detailed Description

Feedback

The transition plan has been discussed at various GNU Tools Cauldrons. Feedback has been generally positive, except a general worry about the work required.

Without a deliberate porting effort, a lot of breakage occurs, seen in 2016 in Fedora with an uncoordinated change, and more recently an uncoordinated Clang update.

Benefit to Fedora

Programmers will no longer waste time tracking down things that look eerily like compiler or ABI bugs because in several cases, builds will fail with a clear error message, instead of producing a warning that is easily missed. Potential blockers to adoption of further C language changes are removed.

Scope

  • Proposal owners: Update rawhide over time to be compatible with strict C99 compilers.
  • Other developers: Help out with non-obvious porting issues, and with upstreaming patches in case active upstreams cannot be easily identified. Tolerate early backports of upstream-submitted fixes in Fedora dist-git.
  • Policies and guidelines: Fedora compiler policy will likely change due to the adoption of GCC 14 in Fedora 40.
  • Trademark approval: N/A (not needed for this Change)
  • Alignment with Objectives: N/A

Upgrade/compatibility impact

The change is expected to be transparent to those users who do not use C compilers. No features are supposed to be added or removed as a result. In fact, most of the porting effort focuses on avoiding configuration changes.

How To Test

General regression testing is sufficient.

User Experience

User experience does not change.

Dependencies

To avoid regressing the porting effort, GCC as the system compiler needs to reject obsolete constructs by default. This is expected for GCC 14, to be released as part of Fedora 40 in Spring 2024.

Contingency Plan

  • Contingency mechanism: Upstream GCC will probably accept obsolete constructs longer in case distributions like Fedora cannot port to modern C in time.
  • Blocks release? No if GCC doesn't switch. If GCC switches, we have to complete the port.


Documentation

This section will be updated once more documentation of the porting effort will become available.

Release Notes

Probably not needed because no user visible impact is intended.