Menu

MCPP and paste macros

BH
2008-10-29
2013-05-28
  • BH

    BH - 2008-10-29

    The logout macro doesn't seem to get expanded in this case, is this the expected behavior?

    #pragma MCPP debug token expand macro_call
    #define logout(fmt, args...) (fprintf(stderr, "EE100\t%-28s" fmt, __func__, ##args))

    #line 725 (xen-3.3.0/tools/ioemu/hw/e100.c) =>             logout("EEPROM trace:\n");<^J>
    #line 726 (xen-3.3.0/tools/ioemu/hw/e100.c) =>             fprintf(stderr, "\toperation: %s\n", opname);<^J>

     
    • Kiyoshi Matsui

      Kiyoshi Matsui - 2008-10-30

      That 'logout' macro is not a C99-comformant variadic macro, but it is a GCC-local variadic macro.  Are you using a compiler-independent-built mcpp, such as the binary packages on this site?  The compiler-independent-built mcpp does not recognize GCC-local variadic macro, and issues an error on it.

      The GCC-specific-built mcpp will preprocess GCC-local variadic macro as expected, as well as C99 one.  You can make it from the source of mcpp.

       

Log in to post a comment.