tags:

views:

219

answers:

2

Dear All,

It's possible to use TRACE macro as printf like function (variable argument list) . If it supports this facility, then why it's necessary to have TRACE0, TRACE1 and TRACE2 macros except they're imposing restrictions on number of arguments. Again, I'd like to know if there are any advantages on restricting number of arguments for TRACE macro.

A: 

It isn't necessary to have the other trace variants (trace1, trace2 etc), but it does mean that you don't have the worry of checking that you've got the correct number of arguments to go along with your format statement (for the trace macro).

Having a look at the macro definition for these macros: it's quite a good read!

Moleski
A: 

If I recall correctly, MFC 4 did not have variadic TRACE statements. That was added in a later version. The old-style TRACEn macros are probably there for backward compatability.

Ferruccio