Overly-keen format string warning?
Dave Korn
dave.korn.cygwin@googlemail.com
Tue Sep 15 17:20:00 GMT 2009
Michael Meissner wrote:
> On Tue, Sep 15, 2009 at 05:20:06PM +0100, Dave Korn wrote:
>> I added some debugging printfs, and ...
>>
>>> cc1: warnings being treated as errors
>>> /gnu/gcc/gcc/gcc/dwarf2out.c: In function 'add_location_or_const_value_attribute
>>> ':
>>> /gnu/gcc/gcc/gcc/dwarf2out.c:13532:1: error: format '%p' expects type 'void *',
>>> but argument 3 has type 'struct var_loc_list *'
>>> /gnu/gcc/gcc/gcc/dwarf2out.c:13532:1: error: format '%p' expects type 'void *',
>>> but argument 4 has type 'struct var_loc_node *'
>>> /gnu/gcc/gcc/gcc/dwarf2out.c:13532:1: error: format '%p' expects type 'void *',
>>> but argument 5 has type 'rtx'
>>> /gnu/gcc/gcc/gcc/dwarf2out.c:13532:1: error: format '%p' expects type 'void *',
>>> but argument 3 has type 'struct var_loc_list *'
>>> /gnu/gcc/gcc/gcc/dwarf2out.c:13532:1: error: format '%p' expects type 'void *',
>>> but argument 4 has type 'struct var_loc_node *'
>>> /gnu/gcc/gcc/gcc/dwarf2out.c:13532:1: error: format '%p' expects type 'void *',
>>> but argument 5 has type 'rtx'
>>> make: *** [dwarf2out.o] Error 1
>>>
>>> DKAdmin@ubik /gnu/gcc/obj.libstdc.enabled/gcc
>> Should the format string warnings really be complaining about this on a
>> platform (i686-pc-cygwin) where there's only one kind of pointer? I don't get
>> the rationale, if this is intentional.
>
> Yes. It still is a type violation,
Ah, it's because pointers can't decay to void as an unnamed stdargs
argument, isn't it? Thanks.
cheers,
DaveK
More information about the Gcc
mailing list