This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __main


> Fergus Henderson wrote:-
> 
> > On 02-Sep-2002, Mike Laman <mlaman@cox.net> wrote:
> > > I'm creating the port (working on my third month on this project).
> > 
> > In that case, why don't you define NAME__MAIN and SYMBOL__MAIN
> > in your target header files?
> > 
> > ("set NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to
> > give the same symbol without quotes for an alternative entry point.
> > You must define both, or neither.")
> 
> Why not just define one in terms of the other?  I could never
> figure that out.

Oh probably because when I added that 10+ years ago there was some reason 
why we couldn't rely on being able to generate a string from a symbol; 
that is, why one of

#define STRINGIFY(X) #X

and

#define STRINGIFY(X) "X"

was failing, though you don't really expect me to remember that now do you?

R.

PS I've always condidered the K+R form a truly gross hack; there certainly 
was nothing in K+R1 that suggested this had to work.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]