This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __main
- From: Richard Earnshaw <rearnsha at cambridge dot arm dot com>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>, Mike Laman <mlaman at cox dot net>, GCC <gcc at gcc dot gnu dot org>, Richard dot Earnshaw at arm dot com
- Date: Wed, 04 Sep 2002 12:01:40 +0100
- Subject: Re: __main
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> 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.