Page 1 of 1

How to C in 2016

Posted: Tue Jan 26, 2016 12:53 am
by JasonX

Re: How to C in 2016

Posted: Sun Mar 06, 2016 5:20 am
by jitspoe
Meanwhile, I'm too lazy to update my compiler (and don't want to risk breaking compatibility for some players), so I'm still using Visual Studio 2010, and half this stuff doesn't work. :)

Re: How to C in 2016

Posted: Sat Mar 26, 2016 12:20 am
by Baker
Sounds the guy who wrote that "advice" is big into unportable code that depends on whose compiler you are using. Maybe that works for him, his environment, the projects he works on and the operating systems that matter to him and the compilers he uses and doesn't use.

Someone saying there is "the one true way" hasn't poked his head out of a hole enough to know that.

C is a thin veneer over assembly language.

More recent C standards have few truly useful features over older C, so sacrificing portability and compile backwards compatibility to be "modern" isn't a very good reason in a lot of cases. Case in point, SDL2 is C-89 compatible as an example.

Re: How to C in 2016

Posted: Sat Mar 26, 2016 8:41 am
by Spike
baker, the only reason to stick to c89 is msvc, and even that is changing now - msvc2015 supposedly implements nearly the full c99 libc requirements (its missing a couple of twiddles, but I doubt you've ever used them).
so really, c89 is finally obsolete. its only the people using obsolete versions of microsoft's tool chains who still need to use it.

Re: How to C in 2016

Posted: Sat Mar 26, 2016 9:04 am
by Baker
Spike wrote:baker, the only reason to stick to c89 is msvc, and even that is changing now - msvc2015 supposedly implements nearly the full c99 libc requirements (its missing a couple of twiddles, but I doubt you've ever used them).
so really, c89 is finally obsolete. its only the people using obsolete versions of microsoft's tool chains who still need to use it.
That's nice to hear. I had always heard that Microsoft would never implement any of the more modern C implementations, so I haven't been paying much attention to new Visual Studio.

/Looks at C89 vs. C99 specs --- well, 5 or 6 of things would be nice.

a) Varadic macros ... but I think Visual Studio has supported those for a while
b) I would hope it supports varadic function sentinels (i.e. last arg must be null for certain functions) -- but I use gcc/clang to catch those.

Anyway, nice to see some improvements.

Re: How to C in 2016

Posted: Sat Mar 26, 2016 11:44 pm
by Baker
@spike --- does Visual Studio 2015 happen to have anonymous union support in C?

/If you know ...

Re: How to C in 2016

Posted: Sun Mar 27, 2016 9:54 am
by Spike
older versions do, so I assume it must have.