Re: C Program [ Turbo-C ] , to extract only-Printable-characters from a file ( any type of file) and display them ( i.e equivalent to "strings" command in UNIX)
- From: "S.Tobias" <siXtY@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 6 Jul 2005 08:11:24 GMT
Lawrence Kirby <lknews@xxxxxxxxxxxxxxx> wrote:
> On Mon, 04 Jul 2005 15:47:41 -0700, Old Wolf wrote:
>
>> Lawrence Kirby wrote:
>>> On Sun, 03 Jul 2005 19:27:48 -0700, Old Wolf wrote:
>>> > Emmanuel Delahaye wrote:
>>> >> SunRise wrote on 02/07/05 :
>>> >>
>>> >>> void main()
>>> >>
>>> >> main() returns int. Always.
>>> >
>>> > In fact the OP's implementation defines "void main(void)" as
>>> > a valid form of main.
>>>
>>> Does it define it formally as an extension or just use it in code
>>> examples? But even if it does that doesn't make the construct valid C,
>>> just valid for that implementation.
>>
>> Well, does the Standard define how an implementation must
>> define its implementation-defined behaviours? :)
>
> C99 says "or in some other implementation-defined manner". The key thing
> about "implementation-defined" is that the implementation must document
> it. So C99 formalises the idea that aform of main() is valid on an
> implementaton not because it "happend to work" but because the the
> implementation documents it as an extension.
>
>> Anyway, I think this qualifies as an exception to "Always",
>> as Emmanuel Delahaye wrote.
>
> In the context of standard C, the topic of this newsgroup, "Always" is
> correct. OK I see an argument that the bit from C99 above legitimises
> documented extensions. I don't like this though because the standard
> doesn't constrain the bahaviour of implementation-defined forms, you
> effectively have undefined behaviour under an implementation-defined
> label. This goes against the nature of the term "implementation-defined"
> which usually gives the implementation a restricted choice of possible
> behaviours. The bottom line is that C99 doesn't specify any behaviour for
> void main(void) and in my book that makes void main(void) an invalid
> construct in C99.
I don't understand what is "undefined" about `void main(void)', would
you please expand on that? ISTM that in defining behaviour the Std
does not distinguish between different `main' forms, and defines it
only where applicable; in `void main(void)' case, the termination
status is (explicitly) unspecified.
--
Stan Tobias
mailx `echo siXtY@xxxxxxxxxxxxxxxxxxxxxxxxxx | sed s/[[:upper:]]//g`
.
- References:
- C Program [ Turbo-C ] , to extract only-Printable-characters from a file ( any type of file) and display them ( i.e equivalent to "strings" command in UNIX)
- From: SunRise
- Re: C Program [ Turbo-C ] , to extract only-Printable-characters from a file ( any type of file) and display them ( i.e equivalent to "strings" command in UNIX)
- From: Emmanuel Delahaye
- Re: C Program [ Turbo-C ] , to extract only-Printable-characters from a file ( any type of file) and display them ( i.e equivalent to "strings" command in UNIX)
- From: Old Wolf
- Re: C Program [ Turbo-C ] , to extract only-Printable-characters from a file ( any type of file) and display them ( i.e equivalent to "strings" command in UNIX)
- From: Lawrence Kirby
- Re: C Program [ Turbo-C ] , to extract only-Printable-characters from a file ( any type of file) and display them ( i.e equivalent to "strings" command in UNIX)
- From: Old Wolf
- Re: C Program [ Turbo-C ] , to extract only-Printable-characters from a file ( any type of file) and display them ( i.e equivalent to "strings" command in UNIX)
- From: Lawrence Kirby
- C Program [ Turbo-C ] , to extract only-Printable-characters from a file ( any type of file) and display them ( i.e equivalent to "strings" command in UNIX)
- Prev by Date: Re: sizes of bit fields
- Next by Date: Byte Alignment of Character to 2 byte
- Previous by thread: Re: C Program [ Turbo-C ] , to extract only-Printable-characters from a file ( any type of file) and display them ( i.e equivalent to "strings" command in UNIX)
- Next by thread: some very simple increment/decremant operator question
- Index(es):
Relevant Pages
|