How to C in 2016

Discuss anything not covered by any of the other categories.
Post Reply
JasonX
Posts: 422
Joined: Tue Apr 21, 2009 2:08 pm

How to C in 2016

Post by JasonX »

jitspoe
Posts: 217
Joined: Mon Jan 17, 2005 5:27 am

Re: How to C in 2016

Post 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. :)
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: How to C in 2016

Post 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.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: How to C in 2016

Post 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.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: How to C in 2016

Post 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.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: How to C in 2016

Post by Baker »

@spike --- does Visual Studio 2015 happen to have anonymous union support in C?

/If you know ...
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: How to C in 2016

Post by Spike »

older versions do, so I assume it must have.
Post Reply