Article View: comp.std.c
Article #4494Re: Help with tree
From: Jerry Coffin
Date: Sat, 16 Dec 1995 20:44
Date: Sat, 16 Dec 1995 20:44
50 lines
2460 bytes
2460 bytes
torek@elf.bsdi.com (Chris Torek) wrote:
[ ... ]
> I looked
>for any sort of limit on recursion depth and found nothing. Section
>2.2.4 (5.2.4 in ISO?) says essentially nothing about the runtime
>environment. We know that at least one program containing one
>32767-byte object must be accepted at compile time (in a hosted
>environment), but do we have any guarantees or limits on recursion
>depth? If I write an otherwise strictly conformant program that
>recurses anywhere from one to ten million times, under which
>failure(s), if any, can I claim to have found a non-conformant
>system? Section 3.3.2.2 guarantees me recursive calls, so what,
>if anything, makes (say) the 428th special when it fails?
As far as I can tell, there's no guarantee about anything that would
typically involve stack-size. Along with no guarantee of depth of
recursion, you have no guarantee about _where_ you can allocate your
32767 byte object - it may have to be automatic, or it may have to be
static to suceed.
My inclincation would be to replace the requirement for a single 32767
byte variable with:
- one 32767 byte variable of auto storage class
- one 32767 byte variable of static storage class
and add:
- ability to call functions having any combination of arguments and
parameters totalling 3 variables of any type, to a total depth of 511,
not including the initial invocation of `main'.
(all three requirements applying only to hosted implementations.)
Under the present rules, you could make a pretty good case that no
program that uses a variable is strictly conforming, since there's no
guarantee as to whether any amount of storage is supported in the
storage class used by that variable.
These rules would be a considerable step toward allowing considerably
more to be strictly conforming, but are still easily met on nearly any
current implementation.
Later,
Jerry.
/* I can barely express my own opinions; I certainly can't
* express anybody else's.
*
* The universe is a figment of its own imagination.
*/
Technical Details
Message-ID:
<4av6pn$8im@natasha.rmii.com>Path:
arc1-ca.pugleaf.net!news.rmii.com!usenetReferences:
<4aqgq5$53f@newsbf02.news.aol.com> <4asgpq$280@elf.bsdi.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.rmii.com!usenet From: jcoffin@rmii.com (Jerry Coffin) Newsgroups: comp.std.c Subject: Re: Help with tree Date: Sat, 16 Dec 1995 20:44:08 GMT Organization: TAEUS Message-ID: <4av6pn$8im@natasha.rmii.com> References: <4aqgq5$53f@newsbf02.news.aol.com> <4asgpq$280@elf.bsdi.com> NNTP-Posting-Host: slip8144.rmii.com X-Newsreader: Forte Free Agent 1.0.82