Date: Fri, 20 Jun 2003 02:44:28 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [Ux2bs_Archive] No. 157 ************************************************** Thursday 19 June 2003 Number 157 ************************************************** Subjects for today 1 Re[2]: Building Apache : Csaba 2 Re: Re[2]: Building Apache : James Moe" **= Email 1 ==========================** Date: Fri, 20 Jun 2003 01:50:17 +0100 From: Csaba Subject: Re[2]: Building Apache Wednesday, March 26, 2003, 6:53:41 PM, sma wrote: ssmc> Ah, yes, that's true (har, har). ssmc> Here is my "true" program (the whole thing, complete): ssmc> void main () ^^^^^^^^^ Every time you say "void main" an angel dies :( void main also contravenes the ISO standard on C. ssmc> { ssmc> ; ssmc> } This is a bad implementation of true. Its return vale is, in fact, undefined. On most (all?) Intel x86 implementations, subroutine return values are returned in EAX. Your main, when compiled, wouldn't alter EAX at all, so its value is likely to be whatever it was before main was called, i.e. at the mercy of the runtime library. A better implementation would be: int main() { return 0; } -- Csaba mailto:adwx88 at uk.uumail.com Ceci n'est pas un .signature! _______________________________________________ UX2BS mailing list UX2BS at os2ports.com http://os2ports.com/mailman/listinfo/ux2bs **= Email 2 ==========================** Date: Fri, 20 Jun 2003 12:34:51 -0700 (MST) From: "James Moe" Subject: Re: Re[2]: Building Apache -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, 20 Jun 2003 01:50:17 +0100, Csaba wrote: >ssmc> void main () > ^^^^^^^^^ >void main also contravenes the ISO standard on C. > C, or C++? Which standard? Which version? Which year? >ssmc> { >ssmc> ; >ssmc> } > >This is a bad implementation of true. Its return vale is, in fact, > Not "bad," just non-conformant with current accepted coding practices. It is a deprecated form. It may even now be unacceptable by a new Standard version. No C compiler has ever rejected the form (even with warnings set at max, although a C++ compiler has), nor (apparently by convention) failed to return a reasonable value, ie, 0. Just lucky, I guess. I wrote the function years before the C++ form had become accepted practice in C programs as well. Had you simply offered a "better" or "more conforming" version, I would not have been offended. But your condescending tone was annoying. In your pedantic fervor you missed the point: "true" is an extremely easy function to provide. >undefined. On most (all?) Intel x86 implementations, subroutine return >values are returned in EAX. Your main, when compiled, wouldn't alter >EAX at all, so its value is likely to be whatever it was before main >was called, i.e. at the mercy of the runtime library. > It is not a subroutine return value. It is a result code given to the invoking shell by the runtime code when the program terminates. - -- jimoe at sohnen-moe dot com pgp/gpg public key: http://www.keyserver.net/en/ -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 5.0 OS/2 for non-commercial use Comment: PGP 5.0 for OS/2 Charset: cp850 wj8DBQE+82HbsxxMki0foKoRAj/BAJ9lJywjTe5zkx68LCietjerW5HAiACg049m e1VzKpAsZjOKQIoJnWp8/nw= =bxgd -----END PGP SIGNATURE----- _______________________________________________ UX2BS mailing list UX2BS at os2ports.com http://os2ports.com/mailman/listinfo/ux2bs