[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avrdude-dev] code restructuring - using C99 or not?
From: |
Hannes Weisbach |
Subject: |
Re: [avrdude-dev] code restructuring - using C99 or not? |
Date: |
Fri, 20 Jul 2012 19:02:19 +0200 |
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] code restructuring - using C99 or not?, Axel Wachtler, 2012/07/20
- Re: [avrdude-dev] code restructuring - using C99 or not?,
Hannes Weisbach <=
- Re: [avrdude-dev] code restructuring - using C99 or not?, Weddington, Eric, 2012/07/20
- Re: [avrdude-dev] code restructuring - using C99 or not?, uracolix, 2012/07/20
- Re: [avrdude-dev] code restructuring - using C99 or not?, Hannes Weisbach, 2012/07/20
- Re: [avrdude-dev] code restructuring - using C99 or not?, Axel Wachtler, 2012/07/21
- Re: [avrdude-dev] code restructuring - using C99 or not?, Weddington, Eric, 2012/07/21
- Re: [avrdude-dev] code restructuring - using C99 or not?, Joerg Wunsch, 2012/07/26
- Re: [avrdude-dev] code restructuring - using C99 or not?, Axel Wachtler, 2012/07/28
- Re: [avrdude-dev] code restructuring - using C99 or not?, Weddington, Eric, 2012/07/20