[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] GCC question



On Tue, 16 Nov 2010 17:31:05 , "Helmut Karlowski" <helmut.karlowski@ish.de> wrote:
> Peter Slegg wrote:
>
> > On Tue, 16 Nov 2010 15:56:36 , xavier.joubert@free.fr wrote:
> > > Hi Peter,
> > >
> > > ----- Peter Slegg <p.slegg@scubadivers.co.uk> a =E9crit :
> > > > http://gcc.gnu.org/onlinedocs/cpp/Misnesting.html
> > > >
> > > > Does this suggest that my error shouldn't happen ?
> > >
> > > The first example suggest that the outter macro is evaluated first. So the
> > > error is expected.
> > >
> > > You could use something like the following instead :
> > > #define my_objc_draw(tree, start) objc_draw(tree, start, tree[0].ob_x-3,tre
> > > e[0].ob_y-3,tree[0].ob_width+6,tree[0].ob_height+6)
> > > .
> > > .
> > > my_objc_draw(dlog, start);
> > >
> >
> > That may be the only way to work around this but there does seem
>
> Why not define the outer macro as inline function?
>
> #ifndef __TURBOC__
> __inline__ void my_objc_draw(dlog, start);
> #else
> ..
> #endif
>
> Correct syntax may differ.

I'm not familiar with inlines, I will look into it.

> > to be a gcc problem when you compare the gcc -E results with those of
> > make.
>
> This is mysterious. You should use the same gcc-command that make uses and add the -E.
>
> My test definitely shows that gcc and bcc behave that way.
>

The Makefile I created lists the .c files starting with the top level newsie.c
which generates this

gcc  -I/usr/GEM/include -w -Wcomment -Wimplicit-int  -m68040 -funsigned-char -fomit-frame-pointer -O2 -fstrength-reduce  -fno-strict-aliasing -DUSE_OVL -DUSE_INET -c newsie.c -o obj.040/newsie.o

and triggers compiling of mailer, newsaes.c, where the macro error occurs.

Should I be making that way or just do them in any order which seems to be
what Highwire does ?

Peter