← Back to team overview

widelands-dev team mailing list archive

Re: %p errors

 

This is the correct syntax - %p is used for pointers. The warnings come
up because the compiler expects void* as the only legal type for this,
altough printf allows any pointer here.

So, not our bug.



Sgrìobh Tibor Bamhor na leanas 03/02/2015 aig 08:33:
> Hi,
> 
> I am editing logic/bob.cc so I got an idea I would fix also following
> compilation errors.
> 
> /var/widelands/seafaring-ai/src/logic/bob.cc:1038:65: warning: format
> '%p' expects argument of type 'void*', but argument 3 has type
> 'Widelands::MapObject*' [-Wformat=]
>    molog("* object pointer: %p\n", m_stack[i].objvar1.get(egbase));
>                                                                  ^
> /var/widelands/seafaring-ai/src/logic/bob.cc:1046:43: warning: format
> '%p' expects argument of type 'void*', but argument 3 has type
> 'Widelands::Path*' [-Wformat=]
>    molog("\n* path: %p\n",  m_stack[i].path);
>                                            ^
> /var/widelands/seafaring-ai/src/logic/bob.cc:1061:43: warning: format
> '%p' expects argument of type 'void*', but argument 3 has type
> 'Widelands::Route*' [-Wformat=]
>    molog("* route: %p\n",  m_stack[i].route);
> 
> 
> Do you know what is the right syntax?
> 
> Thanks
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~widelands-dev
> Post to     : widelands-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~widelands-dev
> More help   : https://help.launchpad.net/ListHelp
> 
> 
> 
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 2015.0.5646 / Virus Database: 4273/9049 - Release Date: 02/03/15
> 


References