pub struct GnucVersion {
pub major: u32,
pub minor: u32,
pub patch: u32,
}Expand description
The GCC release the compiler claims to be, as __GNUC__, __GNUC_MINOR__ and
__GNUC_PATCHLEVEL__.
Design: spec/04-driver-and-cli.md section 4.5, which makes this a knob rather than a
constant and says to start conservative and raise it as the matrix in rucc-gnu fills in.
The default is seven, which is the lowest claim that gets a modern glibc. glibc gates most
of what it hands a caller on __GNUC_PREREQ, so the claim decides which half of
sys/cdefs.h we get, and below seven bits/floatn-common.h writes typedef float _Float32;
over a keyword this compiler already has. Every header that reaches it stops there, which
was most of them: on Ubuntu 24.04’s glibc 2.39 the claim of 4.2.1 that stood here before got
180 of 214 headers through and seven gets 202, and the amalgamated sqlite goes from four
errors to none.
It is still deliberately low. Claiming a version whose promises have not been kept means being handed syntax the compiler cannot parse, so this moves when there is a measurement saying it can. Thirteen and sixteen were measured alongside seven and came out identical on glibc, on the macOS SDK and on sqlite, so the next move up is cheap; it is a separate one because nothing yet needs it.
Fields§
§major: u32__GNUC__.
minor: u32__GNUC_MINOR__.
patch: u32__GNUC_PATCHLEVEL__.
Trait Implementations§
Source§impl Clone for GnucVersion
impl Clone for GnucVersion
Source§fn clone(&self) -> GnucVersion
fn clone(&self) -> GnucVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more