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

C99 or C11?

Name: Anonymous 2013-12-29 4:40

Serious topic. No mention of C89 as it is objectively inferior to C99.

Name: VIPPER 2013-12-29 4:57

C11

Name: Anonymous 2013-12-29 5:41

C89 because C99 is pseudo sepples shit and C11 is even worse.

Name: Anonymous 2013-12-30 2:55

C99 because bigger number is better.

Name: Anonymous 2013-12-31 12:32

I prefer C95, which I feel is actually the height of C standards, although often overlooked because it follows the breakout success of C90 (C89 to those of you who follow the American releases). The ISO was still in their breakout phase during '95, and after the legendary tour of '94 (I was at Geneva, Feb 23) they started to experiment with more progressive themes. This was a bit too fast-paced of a change for most of the old line fans, who just wanted to hear Ritchie play union{ int d; char c;}; , so real gems like the %:%: digraph and wint_t were ignored. Even more, prototypes like int wcsncmp (const wchar_t *, const wchar_t *, size_t) are most often attributed to the later C99, which proved too divisive for most compilers at the time, and the fact that this is still cited as a point in C99's favor should only be taken as a comment on the ages of the fans. As for C99 itself, people tell me I just don't understand stdbool.h, but I've read through it dozens of times, and it doesn't sound fresh at all, more like an experimental failure that caught on for the wrong reasons and then couldn't be forgotten. I can still appreciate the good points of C99, but compared to C95, it just doesn't hold up.

Name: Anonymous 2013-12-31 13:09

Anybody know of a good list describing the differences between each standard?

Name: Not L.A. Calculus 2013-12-31 13:40

>>6
DA STANDARD

Name: Anonymous 2013-12-31 17:07

>>5
does GCC even have an option for c95?

Name: Anonymous 2014-01-01 3:10

>>8
Yup. -std=iso9899:199409

A few brief tests seem to indicate that -ansi includes most/all of the changes to various headers (and the new headers), which isn't surprising, so really the only change between -std=iso9899:199409 and -ansi is the digraph handling.

Name: Anonymous 2014-01-04 4:40

people tell me I just don't understand stdbool.h, but I've read through it dozens of times, and it doesn't sound fresh at all

Name: idiotfrom10 2014-01-04 4:42

I'm a dumbass, anyway, can you explain me better your viewpoint on stdbool.h?

I always thought the only reason for it was to make code clearer (as in, this is a bool, not an int, this will hold a logic value, you shouldn't use it as a number, etc).

Name: Anonymous 2014-01-04 6:00

>>10,11
I mostly agree with Linus on bools (see https://lkml.org/lkml/2013/8/31/138 and ), in that they aren't strictly defined enough for a programmer to use them better than `This is a char or maybe an int depending on how my compiler feels. It is probably zero or nonzero,' and you don't really get any benefit (in packing in structs, for example) that a compiler can't also give to a sanely-used integer type.

In addition, I've never really seen a situation in which I wanted to use bool in which there was a downside to using char or even int instead, because in the place I wanted to use the variable, it was always possible for me to tack on more information like an error code, or some useful metric that divided all inputs into two partitions, etc. That's just my experience, and possibly there exists an example that would make me change my mind, but I doubt it.

I would normally give weight to your clarity argument, but the following compiles for me just fine ([m]gcc -o a a.c -std=c99 -Wall -Werror[/m]):

#include <stdio.h>
#include <stdbool.h>

int main(void)
{
bool t, u;
t = 2;
u = t - 2;
if (u) printf("meh\n");

return 0;
}


and outputs
meh

I know perfectly well why it does so, and I won't say that this program is somehow wrong, but I believe it underscores that in a language like C, bool doesn't really help the programmer avoid performing numerical operations on the values.

But really, the reason I picked on stdbool.h specifically is that a lot of C programmers (like Linus) point to it as proof of C++'s insidious influence upon C.

Name: Anonymous 2014-01-04 18:56

>>12

Thank you for you explanation, I honestly wasn't aware of stdbool subtleties (which taking in account your example code... yikes)

Name: Anonymous 2014-01-06 23:16

59 Name: Lambda A. Calculus 2013-04-10 10:25

>>58
HE DIDNT DIE WIT STEVE JOBS, HE DIED RITE DER IN MY ARMS AS HE DID HIMSELF IN WIT A PISTOL TWO DAYS AFTER DA FINAL DRAFT REVIEW OF C11. DAT FINAL DRAFT IS EXACTLY WAT LED HIM TO SUICIDE. DEM GREEDY, MENACING HYENAS AT ISO WHO RUINED DA LANGUAGE DEANIS RICKY LOVED. DEY'RE DA REASON DEANIS RICKY DID HIMSELF IN, DEY'RE WHAT MADE HIM DEPRESSED OVER DA YEARS, AND DEY'RE DA GREEDY FATCATS WHO TURNED C FROM DA LANGUAGE OF KINGS TO A STEAMING PILE OF SHIT WITH DER GOOTCHY rsize_t TYPE, DER WUNDERFUL THREAD LIBRARY, AND ALL DAT OTHER BULLSHIT. CAN YA BLAME RICKY FOR DOIN' HIMSELF IN WHEN THE WORLD'S FILLED WITH DEEZ FILTHY SCOUNDRELS WHO WILL TAKE A BRIGHT, BEAUTIFUL FLOWER LIKE C89 AND TURN IT INTO A PERVERTED STEAMING PILE OF SHIT LIKE C11?

WHY DA FUCK DO YOU CUNTS THINK THERE WAS NO K&R3 TO COVER C99? WHEN DEANIS RICKY SAW C99 HE SPENT DA WHOLE NIGHT THROWIN' UP. C11 WAS DA LAST FUCKIN STRAW. DA NAIL IN DA FUCKIN COFFIN. I KNOW THIS BECAUSE I WAS DER. I'M DA GUY WHO WROTE MOST OF DA string.h FUNCTIONS DAT YOU SEE NOW IN DA STANDARD C LIBRARY. I KNOWN RICKY SINCE BEFORE C WAS EVEN STANDARDISED. HELL, I KNEW HIM SINCE BEFORE HE EVEN PLANNED ON DESIGNING C.

Name: VIPPER 2014-01-07 6:56

Name: Anonymous 2014-01-18 8:51

C11 is pointless, the amazing new features like static assertions barely work and aren't worth the effort. "const int example = 5; _Static_assert(example == 5); // HURR COMPILE ERROR EXAMPLE IS NOT A CONSTANT EXPRESSION?????"

Name: Anonymous 2014-01-18 12:35

I remember when I first tried to compile a C program with Microsoft's C compiler (I was an ENTERPRISE SEPPLES ``developer'') and it wouldn't, and I didn't understand why. The reason why was that Microsoft's C compiler only compiles C89, and C89 required that every variable be declared at the start of each block.

Name: Anonymous 2014-01-19 4:03

reerererereeeverseeeeeee enecrooos

Name: Anonymous 2014-04-13 23:53

>>12
Actually, I like bools for the exact reason that Linus dislikes them - the implicit casting rules. I like being able to write

bool x;
int y;
x = y;


instead of

unsigned char x; /* Boolean */
int y;
x = !!y;


Having _Bool is especially useful as a defense against morons who would otherwise do stuff like

#define TRUE 1
#define FALSE 0

unsigned char x = 2;

if (x == TRUE)
/* Test fails */

if (x)
/* Test succeeds */


>>16
That's not too surprising given the way const actually works. I think I can agree that _Static_assert is pretty useless given that

#define EXAMPLE 5
#if EXAMPLE != 5
#error HURR COMPILE ERROR
#endif


has worked for ages. In fact the only practical case I can think of where it doesn't work is where EXAMPLE is an enum constant.

The only C11 feature I can actually get behind is cross-platform atomics. The language has really needed something like that for a while now.

Name: Anonymous 2014-04-14 0:29

>>17
Youre a fucking moron and ive told you why before. Fuck off.

Name: Anonymous 2014-04-14 0:31

>>19
Honestly, I think if you're up against programmers who would write that example code, your problems aren't helped by #include <stdbool.h>.

#include <stdio.h>
#include <stdbool.h>

int main(void)
{
int foo = 5;

if (foo == true)
printf("This doesn't get printed, of course.\n");

return 0;
}


_Bool didn't do shit for that example! It's only a defense against that if you tell someone ``Dammit John, don't use if like that!'', and you can tell John that quite easily without stdbool.h.

Name: Anonymous 2014-04-14 0:38

>>21
tell john that foo is not bool

Name: Anonymous 2014-04-14 0:49

>>22
Isn't it just as easy to tell John ``In an if statement, the substatement is executed if and only if the controlling expression compares unequal to 0. There's no restriction that the controlling expression be a bool, so you can just write if (x) {...}.'' ? And then you point him to §6.8.4.1 of draft N1570 or something.

Name: Anonymous 2014-04-14 2:25

>>23
Isn't it just as easy to tell John ...
If john is a code monkey like my boyfriend it isn't

Name: Anonymous 2014-04-14 4:09

>>24
pls be a girl

Name: Anonymous 2014-04-14 14:04

>>25
I am a girl ^-^

Name: Anonymous 2014-04-14 20:25

Plan 9 C is pretty cozy.

Name: Anonymous 2014-04-14 22:30

le gaystorm age

Name: Anonymous 2017-03-01 14:17

Why not ANSI C?

Name: Anonymous 2017-03-01 14:51

gnu11

Name: Anonymous 2017-03-01 19:41

ANSI C == C11

Name: Anonymous 2017-03-01 19:58

ANSI is for mental midgets who can't handle compiler extensions.
When presented with fact C extensions are useful, all their responses are autistic screeching about purity of "standards"(most C extensions don't violate them and standards working groups often get their ideas from...compiler extensions) and portability(when real-world portability of GCC is what matters).

Name: Steve 2017-03-01 20:04

i wrote an ansi c compiler when i i was twelve

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