[En-Nut-Discussion] [RESENT] Nutdisc: cast from DISCOVERY_TELE* to int loses precision
ole.reinhardt at embedded-it.de
Wed May 30 14:10:34 CEST 2012
sorry, I missed your last Mail on this topic.
> on my Opensuse 12.1 X86-64 system, compilation aborts in nutdisc with
> udpthread.cpp: In member function ‘virtual void* CUdpThread::Entry()’:
> udpthread.cpp:155:35: error: cast from ‘DISCOVERY_TELE*’ to ‘int’\
> loses precision [-fpermissive]
> make: *** [nutdisc-udpthread.o] Fehler 1
I just looked into the code and it seems that there is a 64bit pointer
castet to an int. I think an int is still defined as 32 bit here?
Unfortunately I don't know wxWidgets event handling, therefore I don't
clearly understand what "event.SetInt((int)dist);" does. But I think the
pointer to the discovery telegram shall be an argument to this event.
Casting it to a 32 bit value will definately fail.
> By adding -fpermissev as below, things compile. Is this the right solution
> or has anybody a better fix?
This will only suppress the warning, right?
So I think the code must be reworked to pass a correct pointer instead
of a 32 bit integer.
Thermotemp GmbH, Embedded-IT
Embedded Hard-/ Software and Open Source Development,
Integration and Consulting
Geschäftsstelle Siegen - Steinstraße 67 - D-57072 Siegen -
tel +49 (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97
Hauptsitz - Hademarscher Weg 7 - 13503 Berlin
Tel +49 (0)30 4315205 - Fax +49 (0)30 43665002
Geschäftsführer: Jörg Friedrichs, Ole Reinhardt
Handelsregister Berlin Charlottenburg HRB 45978 UstID DE 156329280
More information about the En-Nut-Discussion