Re: [Olena-patches] 694: Add spaces in macros to please icpc.

Roland Levillain <roland@lrde.epita.fr> writes:
/* Icpc chokes when expanding this macro when T is a template type: T is substituted with no additional surrounding space, generating a token `>>'.
G++ has no such problem, but I haven't checked which is the right behavior, required by the ISO standard.
Note that this will no longer be a problem with C++ 0x, since expressions like `Foo<Foo<int>>' will be valid. */
Dans le code de CPP on trouve la fonction suivante : /* Returns nonzero if a space should be inserted to avoid an accidental token paste for output. For simplicity, it is conservative, and occasionally advises a space where one is not needed, e.g. "." and ".2". */ int cpp_avoid_paste (cpp_reader *pfile, const cpp_token *token1, const cpp_token *token2) -- Utilisée dans l'outputing ici. avoid_paste est de gestion interne. /* Subtle logic to output a space if and only if necessary. */ if (avoid_paste) { if (print.source == NULL) print.source = token; if (print.source->flags & PREV_WHITE || (print.prev && cpp_avoid_paste (pfile, print.prev, token)) || (print.prev == NULL && token->type == CPP_HASH)) putc (' ', print.outf); } else if (token->flags & PREV_WHITE) putc (' ', print.outf); Il n'y a pas de commentaire sur le standard dans le code. Je n'ai d'ailleurs rien trouvé dans les standards. Il y en a un pour CPP ? -- /!\ My mail address changed, please update your files accordingly. | In a World without Walls and Fences, Michaël `Micha' Cadilhac | | who needs Windows and Gates? cadilh_m - Epita 2007 - CSI | | -- Dino Esposito JID: micha@amessage.be | `-- - - - - --'
participants (1)
-
michael@cadilhac.name