Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C89 || C99

Name: Anonymous 2011-10-13 15:33

So i'm just learning C now using K & R 2nd edition which is the "Ansi C". Should i care about C99 standards or will C89 be just fine? What are the benefit of going C99?

Name: VIPPER 2011-10-13 15:49

The second is obviously better.
C89 is refered to as ANSI C if i am not mistaken.
As far as i know C99 is just C89 with some extension taken from sepples.
It really doesnt matter.

Name: Anonymous 2011-10-13 16:28

>>2
You are a fucking idiot.

Name: Anonymous 2011-10-13 17:18

Go to C99. Is that simple.

Name: Anonymous 2011-10-13 19:20

Ditch the 2nd edition. The 1st is much better!

Name: Anonymous 2011-10-13 19:25

>>4
You're a fucking idiot. Go scrub another toilet bitch.

Name: Anonymous 2011-10-13 19:29

Go to C11.

Name: Anonymous 2011-10-13 19:39

>>7
give me a C11 compiler

Name: Anonymous 2011-10-13 19:39

There is only one compelling feature of C99: stdint.h

Name: Anonymous 2011-10-13 19:45

>>7
goto considered harmful

Name: Anonymous 2011-10-13 19:51

>>10
Considered harmful considered harmful.

Name: Anonymous 2011-10-13 20:02

B

Name: Anonymous 2011-10-13 23:14

I use "redd".

Because it's the one true redditor.

Name: Anonymous 2011-10-14 3:48

>>1
Learn C99, but don't avoid knowing C89. You'll need the '99isms at least to avoid doing a few awkward things.

And take a look at C1x C11. It's been finalized now, and has some needed improvements. Arguably, in today's world you should start with C11, but that's probably controversial.

Name: Anonymous 2011-10-14 4:29

>>14

U MENA C++11

Name: Anonymous 2011-10-14 13:22

>>14

C11 will be interesting.
One question: why VLAs will become an optional feature? Is it so difficult to implement in some architectures?

Name: VIPPER 2011-10-14 13:55

What the hell is C11?

Name: Anonymous 2011-10-14 15:08

>>14
C1x hasn't been finalized or ratified yet. If it had been submitted for the final vote, there would have been an FDIS document, but the latest draft of the standard is just in the DIS status.

>>16
The problem with VLAs lies in the fact that VLAs created on the stack can cause stack overflows on target platforms that do not have guard pages and dynamically growable stacks. Proponents of VLAs thought there weren't really any trade offs with supporting dynamically stacks, but there are.

Additional stack probes need to be inserted during stack frame creation in every function with VLAs, leading to code bloat and performance degredation.

Additionally, relying on page faults triggered by accessing the guard page to catch the cases where needed stack size upperbound can't be determined at compile time is pretty stupid: it's slow, and on some platforms it can't be universally implemented in user-mode applications as the OS may sandbox user applications from being able to insert their own interrupt and page-fault handlers (think iOS and other locked-down embedded device OSes).

Furthermore, on 32-bit architectures, the address space is already being utilized to the max. Dynamically growable stacks work by reserving large blocks of address space, and only committing physical pages as needed. They work best where you have lots extra address space, like on 64-bit architectures. Asking everyone to give up address space in 32-bit land isn't practical.

So allowing VLAs in the absense of dynamically growable stacks can be problematic for security reasons, it has the same problem as alloca.

>>17
It's the future.

Name: VIPPER 2011-10-14 16:18

>>18
It's the future.
They said that of sepplesox too.

Don't change these.
Name: Email:
Entire Thread Thread List