[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dealing with bad warnings
From: |
Gary V. Vaughan |
Subject: |
Re: Dealing with bad warnings |
Date: |
Thu, 8 Sep 2011 01:01:45 +0700 |
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 *
> my_tigetstr (char const *capname)
> {
> return tigetstr ((char *) capname);
> }
> #undef tigetstr
> #define tigetstr my_tigetstr
>
> If we're talking C++, you can play similar games
> with namespaces, I expect.
Not that I've tried it, but surely you now get a warning in every file
that includes system.h about how the cast is discarding a const instead
of a warning at the original site?
Cheers,
--
Gary V. Vaughan (gary AT gnu DOT org)