I have.
I understand it just fine.
I think our issue has nothing at all to do with the words in the
standard here, but with the question of what it means for the standard
to "mandate" something.
If you want to make a case, you actually have to present some
kind of argument, not just assert that you're right.
Argument. You know. Explanation of how the data you cite allegedly
support your position.
You have provided NONE. That's because there isn't one. It's also because,
before you could do that, you'd have to offer a clear explanation of what
you think it means to say that the standard "mandates" something.
Hint: The general permission to offer extensions means that you can always
accept new kinds of programs that contradict what the standard mandates.
5.1.2 WG14/N1124
"Two execution environments are defined: FREESTANDING and HOSTED. In
both cases, 'program startup' occurs when a designated C program is
called by the execution environment. All objects with static storage
duration shall be "initialized" (set to their initial values) before
program startup. The manner and timing of such initialization are
otherwise unspecified. 'Program termination' returns control to the
execution environment."
"In a freestanding environment (in which C program execution may take
place without any benefit of an operating system) the name and type of
the function called at program startup are implementation-defined. Any
library facilities available to a freestanding program, other than the
minimal set required by clause 4, are implementation-defined."
"The effect of program termination in a freestanding environment is
implementation-defined."
"A hosted environment need not be provided, but shall conform to the
following specifications if present."
[Followed by specifications for int main() in the hosted environment]
The standard doesn't "mandate" int main(). It says what a hosted as
opposed to freestanding execution environment will do with int main().
Other implementations, known as "freestanding" (including any
implementation that doesn't flag void main()) are also standard
implementations, and code that compiles with errors on them is at a
second level "standard". The distinction between hosted and
freestanding is not a moral distinction nor is it a distinction
between "conformant" and "nonconformant".
In fact, it's obvious that the "hosted" implementation was put into
the standard by way of Linux pressure to overlink, in violation of
separation of concerns, C to Linux.
Most contemporary uses of C are "freestanding" in that most C programs
are called from graphical user interfaces not coded in C.
Pressure on organizations to support Linux is represented as some sort
of crusade for "freedom" in the mythos. But the fact is that Linux, as
open source, represents a very valuable resource for profit-making
organizations and to this end, hordes of fools were marshaled and
deluded as Seebach is.
That an implementation is permitted, implicitly or implicitly, to accept a
program, does not mean that the standard did not mandate something contrary
to that program's structure or contents.
When we say the standard "mandates" a return type of int, we mean that, if
you use any other return type for main(), the standard provides you with
no guarantees.
This is false. See above. It simply means that the implementation is
not hosted.
It is quite possible that an individual implementation will
choose to offer you guarantees. It was just as possible in 1989. It doesn't
change what the standard requires.
If you want to write code which conforms to the C standard, for a hosted
implementation, your main() must return int. That compilers *could* accept
No, for only one type of "hosted" implementation: the host as defined
by the standard.
other forms doesn't change that. Similarly, you can't rely on the value
of a right-shifted signed negative number. That an implementation COULD
define that to give you useful results doesn't mean that you can rely on it
and claim to be conforming with the standard.
This is absurd. The Standard is open in the sense that it allows
implementations to have facts about them and programmers to rely on
those facts.
You're saying, in fact, that C must be used like Java to be
"standard". But after ten years doing apparently diddly on the
standards group save pad your resume, you don't understand that the
Standard is a standard for implementations and not C code.
It's not a very good standard for implementation. But for code, it's
nonsense.
A dependency in code on ones being shifted in is what C is for:
systems programming at a level where implementation details,
especially gross implementation details, are usable and known.
I agree that given your queue.c horror, your failure to correctly
implement strlen, and your %s nonsense, you shouldn't be using C and
should retrain in Java, which more resembles the scripting languages
where your expertise seems to lie. By condemning a C programmer
working at a certain depth for knowing his trade (knowing, for
example, that twos complement is in use on his target architecture)
you merely add to what we know: that you're uneducated in computer
science, and fail to compensate for that by being a knowledgeable
programmer.
When this serious pattern of resume padding, stalking and ignorance is
exposed, you embark on campaigns of personal destruction, including
making offensive neologisms out of people's names. You force others to
reply at your childish level. But, don't compete with me:
There's a coder named Dweebach
Who cried alas and alack
My code fails to work
And I know I'm a jerk.
That low level coder named Dweebach.
There's a low level coder named Peter
Who couldn't program a parking meter
Though god knows he tried
But his code, it died
Blue screen of death appeared on his parking meter.
There's a hacker named Seebs
Who's ranked with the feebs
Says he knows C
But he don't, see?
That hopelessly clue challenged Seebs!