Am 20.07.2012 um 12:03 schrieb Axel Wachtler:

> Hallo,
Hello,
> 
> Now I want to encapsulate the fprintf(stderr, ...) statments by 
> a macro, lets say PRINTF.
Me too. Although I opted for a function in avrftdi (again, not yet committed).
> 
> There are two ways to do this: 
> 
> a) C99 style:
>   #define PRINTF(fmt, ...) avrdude_message(fmt, __VA_ARGS__)
>   Usage: PRINTF("foo=%d", 42);
> 
> b) with double braces (works also with none C99 compilers)
>   #define PRINTF(args) avrdude_message args
>   Usage: PRINTF(("foo=%d", 42));
> 
> My question: Is there anybody building avrdude with a none-C99 compiler, 
> e.g. MS Visual C?
> 
> Which one would be the preffered solution a) or b).
b).

Also, I would propose that the macro prints the programmer name (if the message 
is generated by a programmer) or "avrdude: " if it is generated by "general" 
code.
What do you think about printing the function name and line number by directly 
by the macro, if the verbosity level is high enough (3 or so)?

Best regards,
Hannes
_______________________________________________
avrdude-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev

Reply via email to