tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Fixing configure failures from newer gcc
Andrew Cagney <andrew.cagney%gmail.com@localhost> writes:
>> > Having a downstream packaging system try to force local policy on the
>> > upstream developers never ends well.
>>
>> It's not local policy.
>
> But -std is being discussed as a local pkgsrc policy.
No, we are (mostly, as a group position, vs a few random comments)
talking about "if a package needs a specific std and doesn't set it,
mark it to be forced". I don't think there is any support for forcing a
std in general over all packages.
>> It's a failure to work in an environment where
>> it should work, because the world has decided that if you just run cc,
>> you will get some C std by default but you don't know which one.
>> Therefore unless your code is compatible with every C std, from C89 to
>> C23, then your package is buggy.
>
> I think a more reasonable expectation is that a package be buildable
> with the default settings of mainstream compilers less than 5 years
> old (i.e., LTS). While buildable with c23, the package still needs
> to wait a few years before adopting c23 features (like bool being
> defined).
I don't expect code to work with all versions. I meant that code must
either:
- work with all versions
- probe for and set std
and I expect that mostly I will find the second approach. I mentioned
"work with all" intending to describe the rare case where it is not
necessary to document, declare, probe for, and ask for, a specific C
version.
Your default is pretty close in practice; right now it spans from c99 to
c23. I am complaining about packages that don't build with c23 but do
not probe for and set --std=c99.
If a package needs C23 features, it must probe for and set --std=c23,
until the day when it's unthinkable that no one is using a compiler that
defaults to a C standard older than C23. That might be 2035, and it
might be 2040. This is exactly what we see in C++, where there are
programs that use the new features. But mostly they
document/declare/probe/std.
Home |
Main Index |
Thread Index |
Old Index