develooper Front page | perl.perl6.internals | Postings from August 2002

Re: [perl #15907] [PATCH] Make warnings configurable

From:
Nicholas Clark
Date:
August 6, 2002 03:13
Subject:
Re: [perl #15907] [PATCH] Make warnings configurable
Message ID:
20020806111239.R9802@plum.flirble.org
On Mon, Aug 05, 2002 at 04:11:26PM -0700, Brent Dax wrote:
> Jürgen Bömmels:
> # The other warnings I found are a little bit more complicated
> # - nonliteral formats in Parrot_vsprintf_s
> 
> If I understand what is meant by this warning, it's trying to warn about
> the case where you accidentally forgot to give sprintf a format.  I can
> assure you that this is no accident; just cast around it or whatever.

It's where the first argument to printf-like function isn't a literal
string, and the compiler has been instructed to check that the arguments
to printf-like functions correspond to the % format specifiers in the format
string.  The compiler is warning that it's unable to make this check
because the format isn't known at compile time, and I don't know of a
solution.

(Annoyingly, gcc doesn't seem to come with pragmas to say "I acknowledge the
next line does something that I've asked you to warn me about, so don't
warn". I think we've still got the warnings from passing const pointers to
free() and realloc(), and you can't (directly) cast them away.
Although I believe that you can circumvent that warning about casting away
const by using a union of void * and const void *, and laundering your
const-ness away with it)

Nicholas Clark



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About