jacob navia said:
This is wrong. All mainframe implementations use a contiguous
memory area that is accessed by a dedicated register. This
register is increased in the function's prologue and decreased
in the functions epilogue. The machine has no universally
dedicated stack registers but within C it HAS A STACK as I proved with
links to the mainframe's compiler documentation A NUMBER
OF TIMES ALREADY
*All* mainframe implementations do this? Can you prove that by citing
the documentation for *all* such implementations, not just one?
There have been a number of different IBM mainframe architectures, and
a number of different compilers and operating systems for them. I'm
not at all surprised that *some* of them use something very similar to
a typical contiguous hardware stack.
I have no direct experience with the IBM mainframe implementation in
question; I've logged into an IBM mainframe once or twice many years
ago, but I've never programmed one. So my statement was not based on
my own personal experience. But *a* mainframe implementation (IBM, I
think) has been mentioned in this newsgroup that allocates function
activation records on the heap, or on something similar to a heap, so
that consecutively allocated activation records aren't necessarily
contiguous or even ordered in memory. I cannot provide a more
specific citation than that; perhaps someone else can.
But even if that's not the case, it's certainly *possible* that such
an implementation could exist; assuming it's done correctly, it would
not violate the C standard in any way.
Please look it up and stop telling stories.
Thanks
Here is my message from the last discussion we had about this:
-------------------------------------------------------------------
[snip]
There is nothing more "big iron" that the IBM mainframes... at least
within my limited experience since I quit using that environment
in 1984.
The C compiler for the IBM mainframes is "C for VM/ESA", a C89
compiler.
That's *one* C compiler for *one* operating system for *one* class of
IBM mainframes.
We find in the users guide
http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/cbcvpg00/CCONTENTS
3.1.4.3 Accessing Automatic Memory [snip]
I repeat: "... the stack frame needed for the C environment".
The documentation goes on to specify that register 13 (R13) is used to
address this memory.
I could use the same method to prove that int is 32 bits on Unix.
I agree that the vast majority of C implementations use a contiguous
hardware stack. It's even possible that all existing C
implementations do so (examples have been cited here of
implementations that don't, but that might have been erroneous, and I
lack the direct knowledge to judge one way or the other).
But that's not the question.
Here's a very simple question that I'd like you to answer.
Does C insist on storing local variables on the stack?
By "C", I mean the language, not any particular implementation or any
particular set of implementations. By "the stack", I mean a
contiguously allocated hardware stack (which is clearly what the OP
was referring to), not any abstract LIFO data structure.
Yes or no.
If your answer is yes, then you're saying that an implementation that
allocates activation records on the heap must be non-conforming. In
that case, please explain how it fails to conform.