On Mon, 16 Jan 2023 02:32:58 -0600 Igor Korot wrote:
IK> Hi, ALL,
IK> I'm using the latest release on all 3 major platforms.
IK>
IK> Compiling my code on Mac with Xcode (OSX 10.13, Xcode 9.4),
IK> I'm getting following warnings:
IK>
IK> [code]
IK> int value = m_config->Read( "my_key", 2 );
IK> [/code]
IK>
IK> [quote]
IK> Implicit conversion loses integer precision: long to int
IK> [/quote]
IK>
IK> Is it possible to silence that warning somehow?
IK>
IK> The value read is in the range of [1..4].
You can, of course, just add an explicit case after checking that the
value is in the expected range. You also can use
int value;
if ( m_config->Read("my_key", &value, 2) )
....
which would avoid the warning but you'd still need to check the range.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/