← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Assertion in pcbnew/dialogs/dialog_select_net_from_list.cpp

 

I know about %zu, but this is wx Printf, not C99 printf. Does it also support %zu? Do we use it anywhere else?

On Tue, 28 Feb 2017, Sergey A. Borshch wrote:

On 28.02.2017 01:54, Julius Schmidt wrote:
 This patch fixes a format string assertion.
...
 -            txt.Printf( wxT( "%u" ), net->m_PadInNetList.size() );
 +            txt.Printf( wxT( "%u" ), (unsigned)
 net->m_PadInNetList.size() );

std::vector::size() returns size_t type. Why should you typecast variable type instead of fixing format specifier to be consistent with actual variable type?
There is %zu format specifier designed specially for size_t type since C99.

--
Regards,
  Sergey A. Borshch            mailto: sb-sf@xxxxxxxxxxxxxxx
    SB ELDI ltd. Riga, Latvia

_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp




Follow ups

References