kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #28299
Re: [PATCH] Assertion in pcbnew/dialogs/dialog_select_net_from_list.cpp
-
To:
KiCad Developers <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
From:
"Sergey A. Borshch" <sb-sf@xxxxxxxxxxxxxxxxxxxxx>
-
Date:
Tue, 28 Feb 2017 09:24:39 +0200
-
In-reply-to:
<alpine.LNX.2.00.1702280052590.4258@phi>
-
Organization:
"SB ELDI" ltd.
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1
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
Follow ups
References