On Thu Feb 21 13:52:31 2008, coke wrote:
> On Fri Nov 02 07:56:44 2007, particle wrote:
> > as per PDD07 (r22655,) c macro args *must* be wrapped in parens inside
> > macro bodies, to allow expressions passed as macro parameters.
> > 
> > for example, i expect:
> >  #define CLASS_has_alien_parents_TEST(o)
> > CLASS_flag_TEST(has_alien_parents, (o))
> > instead of
> >  #define CLASS_has_alien_parents_TEST(o)
> > CLASS_flag_TEST(has_alien_parents, o)
> > 
> > this entails conversion of all current macros to meet this criterion,
> > and a test to ensure compliance.
> > ~jerry
> 
> After a few false starts, we now have t/codingstd/c_macro_args.t which
> is currently reporting 502 macro/arg combinations where the parens are
> not used.
> 
> To close out this ticket, this test should pass, and be added to the
> list of codingstd tests in lib/Parrot/Harness/DefaultTests.pm

The test now passes, although I'll leave this ticket open until someone
can confirm that it still does the right thing.  

The new version of t/codingstd/c_macro_args.t as of r29372 has several
special cases: stringification, concatenation, use of args as types when
pointers to that type are cast/created, function argument
instrumentation, args as function names and macros which recursively use
macros which use concatenation.  This last case is used mostly in
includes/parrot/pobj.h for testing, setting and clearing flags.  These
macros could be rewritten, but there are enough of them that it's easier
just to tell the test that these macros are ok.

I would appreciate comments on whether this is the right approach.

Thanks,
Christoph

Reply via email to