pub struct Feature {
pub name: &'static str,
pub kind: Kind,
pub gcc_version: &'static str,
pub status: Status,
pub signature: &'static str,
pub library: &'static str,
pub answer: Answer,
pub value: u32,
pub used_by: &'static [&'static str],
pub tests: &'static [&'static str],
pub notes: &'static str,
}Expand description
One row of the matrix.
Fields§
§name: &'static strThe spelling asked about, with no __ armour on it.
kind: KindWhich operator answers for it.
gcc_version: &'static strThe GCC release that introduced it.
status: StatusHow far along it is.
signature: &'static strThe type a builtin has, written as a C prototype without the name, or empty.
Empty for everything that is not a builtin, and for a builtin whose type depends on
what it is handed: __builtin_constant_p takes anything, __builtin_add_overflow
takes three types that have to agree, and the atomics are a family rather than a
function. Those are decided where the arguments are, and a fixed type here would be a
worse answer than none.
It is a string rather than a structure because size_t is a different type on two
targets and this table has no target. The compiler reads it once per builtin it is
asked for. The set of words it may use is fixed and build.rs checks it, so a typo
fails this crate’s build rather than the compile of whoever first calls the builtin.
library: &'static strThe library function this builtin is, for the family where that is the whole answer.
Empty for everything else. GCC’s __builtin_abort is a call to abort, its
__builtin_strlen a call to strlen, and the prefix is there so that a program can
reach the function the C library promises even where its own name has been taken by a
macro or by a definition of its own. GCC folds some of these when the arguments allow
it, and folding is an optimization on top: the call is the meaning, and a compiler that
only ever emits the call is right and slow rather than wrong.
The name is written out rather than worked out by stripping the prefix, because the two are the same for every row here and need not be for the next one, and a table that says what it means is worth more than one that saves thirty words.
answer: AnswerWhat to do when it is met and is not implemented.
value: u32What __has_c_attribute answers with, which the standard fixes per attribute. One for
every other kind, where the operators answer one or nothing.
used_by: &'static [&'static str]Projects known to need it, from the corpus in spec/15-testing.md.
tests: &'static [&'static str]The tests that prove the status, named as crate::test or as a file path.
notes: &'static strAnything a reader needs that the fields above do not say.