Follow

In an early version of the C compiler gcc, when the pragma directive was introduced, it took the "implementation-defined" effect literally and tried to launch computer games.

@RadicalEdward classic stallman move, doing something totally unhelpful to push a point at people who can't do anything about it

@Canageek @KitRedgrave @RadicalEdward Compiler-specific. In Xcode, there's pragmas to turn on/off various error checking, memory safety, leave markers in the editor, all sorts of things. MS's compilers have different ones. Very useful, not even a little portable. gcc's behavior there was inane.

@KitRedgrave @RadicalEdward Yeah like the proper response is to error out so that future implementations can use it without worrying about ./configure launching rogue. Like WTF.

@KitRedgrave @RadicalEdward I for one think it's funny, I just would have preferred Dungeon Crawl Stone Soup.

Then again that didn't exist at the time. Which leads to an actual point, context. The version cited there was released in 1989. It was a different time. GCC was released only two years earlier, Linux 3-4 years later, it certainly didn't play the role it does today.

Would it be a bad idea to do this today? Probably. Back then it may have been a perfectly fine joke among friends.

@RadicalEdward The problem of "implementation-defined" and "undefined" behaviours that are too numerous in C and C++: the compiler can do anything (ignoring the lines, launching a game, removing the files, formating the disks, etc.). Those should not exist in a programming language.

@drwho

I'm not.

As long as the implemented behaviors are properly documented, undefined behaviours can be useful hooks: don't forget that C is a language designed to be used in a wide variety of use cases: portability is valuable in many of them, but sometimes is not relevant at all.

@Feufochmar @RadicalEdward

@RadicalEdward as a kind of related point, people actually like user-hostile compilers.

The real point here is about implementation and undefined behaviour, and how compilers can be turbounforgiving in these circumstances. But developers consistently vote for dangerous UB handling. How is this?

They consistently rank compilers by speed of the generated code. If gcc produces code that's 10% faster, but relies on aggressive UB handling, people will continue to propose its use over safer, slower compilers.

This is a world of our own making.

Sign in to participate in the conversation
hackers.town

A bunch of technomancers in the fediverse. Keep it fairly clean please. This arcology is for all who wash up upon it's digital shore.