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

Register Variables

Name: Anonymous 2011-09-25 10:47

How exactly do register variables work in C? When should they be used? K&R touches upon them briefly but moves right along. Is there any source in which I can read about them in depth?

Name: sage 2011-09-25 23:03

>>36

It is illegal. Flexible arrays are illegal in C89. They're written as "[]" in C99. It does not matter whether it's supported as an extension or not. It's not pure C: it's a C dialect.

Also, it's clear from the context that I was talking about situations different from flexible arrays.

Just read the standard and fuck off.

>>37

Do what?

If the compiler goes against the standard, then it's non-conformant.
If it extends an area where the standard yields unspecified or undefined behavior, it's conformant. Programs which use the feature are conformant, but not strict-conformant.

For example, if the compiler does not yield a diagnostic message when required to, it's non-conformant. Whether it's relevant or not to the code, it does not matter: the standard does not guarantee any further behavior.

Simple as this.

>>39

I guess it would be used in situations where a type whose size is zero is useful (sizeof(void) == 0), for example, when creating some metaprogramming macros.

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