C is NOT a portable assembler (was: want to know)

Rahul Dhesi dhesi at sun505.UUCP
Wed Aug 30 01:46:32 AEST 1989


In article <2600 at trantor.harris-atd.com> bbadger at x102c.harris-atd.com (Badger
BA 64810) writes:
>The question here was whether ``main()'' is an attractive feature of
>the C language.  That is, why can't all routines have a programmer-chosen
>name?  This is an issue in expressiveness, and questions an apparently 
>gratuitous irregularity in the language.  

The question is really broader, and much more philospphical:

     Should information about the entry point be encoded in the C
     program itself, or should it be external to the program?

(The "entry point" of a C program is where the C virtual machine
defined by the language begins execution, which may not be the place
where execution actually begins.)

For my money, I had better be able to tell, just by looking at the C
source, where execution will begin.  Whether I do this by grepping for
'main.*(', or by searching for '#pragma begin_here' or 'hey mr. linker,
make my day, start this program here i say' etc., is a syntactic detail
in the same category as using { and } rather than BEGIN and END.
--
Rahul Dhesi <cirrusl!dhesi at oliveb.ATC.olivetti.com>
UUCP:  oliveb!cirrusl!dhesi



More information about the Comp.lang.c mailing list