Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Freestanding Environment Date: Tue, 20 Jun 2017 08:32:47 -0700 Organization: None to speak of Lines: 45 Message-ID: References: <1e3276f6-4c94-462e-8ecd-a12686ee089f@googlegroups.com> <76ac7ac3-01dc-43c5-ae97-016b115c5aaf@googlegroups.com> <4e525014-ab98-472f-9715-338286b64a1e@googlegroups.com> <68adbb20-e9e5-44fe-9af2-9bf9c8afc468@googlegroups.com> <03ff1b95-c8b8-4631-a31d-b566a33626dc@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="6d63db2e8ea996f9a358079ee566ecd1"; logging-data="28105"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19LGOlKcXhRZh/lVTKcFvE9" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:BRdR0pZXUMP317eTxL0XDkLzKFk= sha1:KxxNnkb8fzFG95M40GETCiA5nT4= Xref: csiph.com comp.lang.c:112691 David Kleinecke writes: > On Monday, June 19, 2017 at 9:11:07 AM UTC-7, Keith Thompson wrote: [...] >> 5.1.2.1 of the current C11 standard says: >> >> 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 implementationdefined. >> >> The phrase "*the* function called at program startup" seems to me to >> imply that there is one such function for a given implementation. >> It might not be called "main", and it might have different type >> than the main function used by a hosted implementation. >> >> On the other hand, if an implementation lets the programmer configure >> the identify of the startup function, I don't think that would be >> a conformance problem, as long as it's documented. > > That is my reading, too. > > Hence where to start is externally-supplied information How do you get "externally-supplied" from what I wrote? External relative to what? For example, a conforming freestanding implementation might say: The function called at program startup is named "Startup", and is defined as: void Startup(void) { /* ... */ } and provide no mechanism to use a different startup function. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"