Dealing with bad warnings

2011-09-07 Thread Reuben Thomas
I like warnings, I like to turn them all on, and I like to use --enable-gcc-warnings to force them on my attention. And then just occasionally the warnings are misguided. One example is old APIs. For example, from terminfo: char *tigetstr (char *capname); So, one can't call, e.g. tigetstr(kbs)

Re: Dealing with bad warnings

2011-09-07 Thread Paul Eggert
On 09/07/11 04:55, Reuben Thomas wrote: For example, from terminfo: char *tigetstr (char *capname); So, what's a hacker to do? If we're talking C, you can put this into your application's system.h file: static inline char * my_tigetstr (char const *capname) { return tigetstr ((char *)

Re: Dealing with bad warnings

2011-09-07 Thread Gary V. Vaughan
Hi Paul, Reuben, On 7 Sep 2011, at 21:18, Paul Eggert wrote: On 09/07/11 04:55, Reuben Thomas wrote: For example, from terminfo: char *tigetstr (char *capname); So, what's a hacker to do? If we're talking C, you can put this into your application's system.h file: static inline char *

Re: Dealing with bad warnings

2011-09-07 Thread Paul Eggert
On 09/07/11 11:01, Gary V. Vaughan wrote: static inline char * my_tigetstr (char const *capname) { return tigetstr ((char *) capname); } #undef tigetstr #define tigetstr my_tigetstr Not that I've tried it, but surely you now get a warning in every file that includes system.h about