Hello.

While compiling 2.6.11 on IRIX with MIPSpro, I bumped into the following
problem:

   char *arg = alloca_strdup(args->getarg(modeind));

where args is a recursive definition itself..

  #define args      (parent->args)

and alloca_strdup uses its argument multiple times giving the following
(non-compiling, pretty ugly :) code:

  char *arg = 
((((parent->(parent->args))->getarg(modeind)))?strcpy((char*)__builtin_alloca(strlen((((parent->(parent->args))->getarg(modeind))))+1+0),(((parent->(parent->args))->getarg(modeind)))):((0)==0?0:(char*)__builtin_alloca((0))));

The following modified code compiles though:

   char *arg = args->getarg(modeind);
   arg = alloca_strdup(arg);


Mixing recursive macros with macros using its argument multiple times is
just begging for problems.. And now I ran into one :)

Thanks for the best text mode client out there ;)

/Tomas
-- 
Tomas Ögren, [EMAIL PROTECTED], http://www.ing.umu.se/~stric/
|- Student at Computing Science, University of Umeå
`- Sysadmin at {cs,ing,acc}.umu.se

Reply via email to