Hello Felipe,
I understand that. The problem is that when you do that, PRINTF() calls
will cause compiler warnings because disabling console output redefines
PRINTF to be an empty string, but the arguments passed to it remain in
the source file to get compiled, resulting in the warning. For example,
code containing this PRINTF call:
PRINTF("this is a format string to print out an integer\n", 1);
will expand to either
DbgConsole_Printf("this is a format string to print out an integer\n", 1);
if SDK_DEBUGCONSOLE == DEBUGCONSOLE_REDIRECT_TO_SDK,
or
printf("this is a format string to print out an integer\n", 1);
if SDK_DEBUGCONSOLE == DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN.
But when you set SDK_DEBUGCONSOLE to DEBUGCONSOLE_DISABLE, it expands to
this:
("this is a format string to print out an integer\n", 1);
which causes a compiler warning. What it should compile to is this:
;
To get rid of the warnings in this case, instead of defining printf as
an empty string:
#define PRINTF
in which case the above example expands to the orphan argument list in
the example above
it needs to be defined as a macro with variadic arguments:
#define PRINTF(format, ...)
This will cause the entire PRINTF call, including arguments to be
replaced with a null string.
Best regards,
Roger