On Wed, 21 Apr 2010, Eric Pouech wrote:
Francois Gouget a écrit :
There were two problems:
- the semi-colon was missing for non-GNUC compilers as you mentioned
- gcc 2.95 does not support __attribute__() on function pointers
Unfortunately your patch does not fix the second issue. A solution that would not require dbg_vprintf() would be to check the gcc version before trying to use __attribute__().
[...]
does the attached patch works better ? (I tried your suggestion starting at gcc 3.0)
Yes, that works. It means that we won't get the benefit of printf format checking on gcc 2.95 but that does not matter since pretty much everyone will do these checks already. And your patch is simpler than mine (and more importantly works).