widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #03564
Re: %p errors
-
To:
widelands-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Fòram na Gàidhlig <fios@xxxxxxxxxxxxxxxxxxx>
-
Date:
Tue, 03 Feb 2015 10:45:39 +0100
-
In-reply-to:
<CAGCtC0B9GDgk9=fe-qH4sN+8hjATBfmTrhgtGLOjqaqv0swfgA@mail.gmail.com>
-
User-agent:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0
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