@sir How is it GCC's fault people don't stick to standards?

I used the default GNU extensions unwittingly and paid the portability price, code wouldn't compile on clang. (Side note. If you alias gcc to clang, I hate you.) My solution was to just use a cross platform implementation of the Gnuism, because it was a useful addition.

The reason C programmers use Gnuisms is because they're helpful. If you want strict C89 compliance, set up the compiler flags and test under multiple compilers. Then you can run reliably run on PowerPC or whatever.

Alternatively, learn autotools and learn to write truley portable software. There are more quirks to deal with then Gnuisms. GCC just happens to be very popular.

Or just stop using C.

@petit it's GCC's fault for making non-standard extensions available in the first place. This extends to GNU as a whole, it's a really shit habit they have and the entire computer science ecosystem suffers under the heel of their garbage

@petit GNU is perhaps the single largest threat to software quality in our entire ecosystem

@sir

Out of curiosity, how many software and libraries running on sr.ht have been developed on systems and well... basically exist thanks to GNU tools?

@petit

@sir @Shamar @petit

i think the implication is that the tools you used to make sr.ht were developed on a GNU system or using GNU tools.

@xj9 @Shamar @petit what, so I should be thankful because I have third-order exposure to GNU trash? I bet some people have sent me patches they wrote on Windows, too, that's only 1 order removed so clearly Windows is a force for good and I ought to be thankful to Microsoft

@sir @petit @Shamar

:thinking_cirno:​ oh idk i've just heard this kind of thing a lot. i'd like to have exactly zero lines of GNU code in my life to be perfectly honest. that's one of the things that attracted me to Apline in the first place.
@xj9 @sir @Shamar Alright, you all work this out for me. One of the extensions to GCC is integer overflow semantics for signed types. Is this okay or should GCC provide no standard signed overflow behavior?

@petit @Shamar @xj9 C compilers should abort on undefined behavior, rather than take it as license to do whatever they want. Signed integer overflow is no exception to this

Follow

long, on undefined behaviours, human sin, computing history and why people should read the C standard before blaming GCC 

@sir

Are you sure?

Because the say something different.

On section 3.4.3 the standard defines "undefined behaiour" as "behavior upon use of a nonportable or erroneous program construct or of erroneous data,for which this International Standard imposes no requirements"

The standard also clarify: "Possible undefined behavior ranges from ignoring the situation completely with unpredictable results, to behaving during translation or program execution in a documented manner characteristic of the environment (with or without the issuance of a diagnostic message), to terminating a translation or execution (with the issuance of a diagnostic message)."

In section 4, about Conformance, the standard says: "A program that is correct in all other aspects, operating on correct data, containing unspecified behavior shall be a correct program and act in accordance with 5.1.2.3"

And then add "A strictly conforming program shall use only those features of the language and library specified in this International Standard.2)It shall not produce output dependent on any unspecified, undefined, or implementation-defined behavior and shall not exceed any minimum implementation limit."

Note the wording used: in a STRICTLY conforming program the output must not depends on undefined behaviour, but it doesn't exclude undefined behaviours in a CORRECT program!

That's because C was designed as a low level language: undefined behaviour were basically hook for compiler designers.

So ultimately GCC is just handling undefined behaviour BY THE STANDARD.

And this way of handling undefined behaviour is not a C invention.

Algol 68 standard said:
"1.1.4.3. Undefined
a) If something is left “undefined” or is said to be “undefined”, then this means that it is not defined by this Report alone and that, for its definition, information from outside this Report has to be taken into account. {A distinction must be drawn between the yielding of an undefined value (whereupon elaboration continues with possibly unpredictable results) and the complete undefinedness of the further elaboration. The action to be taken in this latter case is at the discretion of the implementer, and may be some form of continuation (but not necessarily the same as any other implementer’s continuation), or some form of interruption (2.1.4.3.h) brought about by some run-time check.}
b) If some condition is “required” to be satisfied during some elaboration then, if it is not so satisfied, the further elaboration is undefined."

Don't blame GNU Compiler Collection!

It's just that we are all tightly coupled!

And we are all brothers, all subject to the original sin. ;-)

@petit @xj9

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.