It's surreal how slowly time moves in the world of C compilers.
Today there are still active projects that are hesitant to move past C89, and C99 is still the "new" standard.
The C99 standard has been released before the first public Mac OS X and Windows XP. It's older Itanium and the x86-64 instruction set. It predates iPod, Game Cube, first ever Xbox, and Nokia 3310.
Entire platforms lived and died in the meantime, while C programmers still can't be sure if they can rely on the new C99.
@kornel and yet msvc still doesn't fully support c99
@federicomena @NanoRaptor @kornel I feel this so hard, working on a >20-year “legacy” code base
@federicomena @kornel "History shall call us SREs."
@federicomena @kornel@mastodon.social Technical payday loan.
@federicomena @kornel My actively utilized COBOL code requests you kindly and temporarily hoist its hoppy beverage, kind sir!
@kornel happily we have autotools to set defines to show which features we can use :D :D :D
@kornel maybe the fear of moving to 3 digits, as they typed their version as an int(2) everywhere?
@kornel It wasn't that long ago that the X11 source code still had optional support for C89 function prototypes.
The headers used preprocessor magic so they could remove the argument definitions from function prototypes, and all the C source files used K&R function definitions.
It comes from a time when upgrading the compiler wasn't really a thing you did. You'd use the one your UNIX vendor provided you, and be happy with it.
@kornel Looking at the history, the "#if NeedsFunctionPrototypes" guards were removed in 2003 or 2004: https://gitlab.freedesktop.org/xorg/lib/libx11/-/commit/c6349f43193b74a3c09945f3093a871b0157ba47, and the K&R function definitions in 2007: https://gitlab.freedesktop.org/xorg/lib/libx11/-/commit/a48386ce6b5f8fd2d9dc11a966c9bf5da59f3831
Based on that timescale, it is probably safe to treat C99 as a given now.
@dascandy @kornel It looks like even Zlib has dropped K&R support in the 1.3 release from August last year: https://www.zlib.net/ChangeLog.txt
So if you are as conservative as Zlib, I guess you can adopt C17 in 2051.
@jamesh "It wasn't that long ago" put in a different light, then, namely 20 years ago.
@malwareminigun @kornel There was a period of time when Sun included a K&R C compiler with the OS and sold an ANSI C compiler as an optional extra. At that time, if you were distributing software as source, using ANSI C would mean only people who paid extra could use your code.
I don't think anyone sees "new language version support" as something they can charge extra for now, which is good.
@kornel i switched ircII to C89 minimum in 2004, and C99 minimum in 2014, and this is not a new, fast moving, rapidly evolving project.
@kornel I blame Microsoft for that. The last time I checked (which isn't even that long ago. 201x?) their C compiler still didn't have full C99 standard compliance.
@oblomov @kornel
Nowadays they support C11 and C17 (the "required" parts of the standards, not the optional ones): https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/
But as they apparently don't want to implement VLAs, they will never support C99 (they became optional in C11).
Anyway, Microsoft *definitely* is to blame for this, because only with VS2015 they started to aim towards C99 conformance at least in their standardlib, e.g. with a standards-conforming snprintf()
@kornel any ideas as to how prevalent this issue is in the C++ world side of things?
Can’t speak to C but the first and last time I learned and touched/wrote anything C++ it had to’ve been version 98, MAYBE C++03 but that would’ve been brand new at the time.
I’m amazed by what I see folks do and write now with it. But how often do big existing projects and products really upgrade? I hope it’s plenty but I have a feeling it’s the opposite.
@kornel In fairness, this is just as much to do with vendors being unwilling to *implement* C99 as with programmers' reluctance to change it. See https://en.cppreference.com/w/c/compiler_support/99
In particular, VLAs turned out to be something of a misfeature and were made optional in C11.
There are a lot of C implementations in the world, and a lot of C programmers care about working with some weird ones, and that means C89 a lot of the time :/
@malwareminigun @kornel don't forget that niche or dead platforms are like pokemon, gotta catch em all
@kornel
If that should only underline C's advantage then I agree.
I really dislike the evolution of modern languages, lots of new features appearing every year, only adding complexity and making #opensource modifications difficult. TypeScript is a good example :(
@cdamian @skolima There's a difference between stability and stagnation. The downside for C is that it's impossible to fix anything in the language, because it will take 20+ years to become the baseline. I suspect C++ mis-evolution has scared C users into *don't change anything ever!*.
Both C and C++ are outliers. It's possible to be stable without stagnation: Java and C# evolved without jumping the shark. PHP cleaned up a ton of language warts. Go can ship quickly without breaking things.
@kornel as far as I know Firefox uses C++17 currently (still quite old)
@kornel I mean, let's be real here: this kind of thing is entirely Sr. Engineers in leadership positions who are scared of learning new things.