c:

Jaromir Sukuba jarin.hw na gmail.com
Sobota Červenec 8 23:45:59 CEST 2017


Kompilator sa snazi naznacit, ze sa chystate natlacit okruhlu
skladacku do otvoru pre stvorcovu skladacku *
    volatile unsigned int x;
    x = ((unsigned int)(0x123));
warning nesposobi, ale
    volatile unsigned int x;
    x = ((unsigned char)(0x123));
uz ano, podobne ako aj ked bude x zadefinovany ako char. Na druhu stranu
    volatile unsigned int x;
    x = ((unsigned char)(0x23));
warning nesposobi, ani ked x bude char.


* http://imgur.com/a/hAcbL


2017-07-08 22:40 GMT+02:00 Jaroslav Buchta <jaroslav.buchta na hascomp.cz>:
> volatile unsigned char x = (unsigned char)((unsigned int)0x0111 & (unsigned
> int)0xff);
> zpusobi warning take?
>
>
> Dne 08.07.2017 v 21:22 Miroslav Draxal napsal(a):
>
>> volatile unsigned char x = 0x0111 & 0xff;
>> stále
>> warning: (751) arithmetic overflow in constant expression
>>
>>
>> S tím #if máte samozřejmě pravdu. A analogicky ne 0x01ff ale 0x0200
>> Míra
>>
>> -----Original Message-----
>> From: Hw-list [mailto:hw-list-bounces na list.hw.cz] On Behalf Of Jan
>> Waclawek
>> Sent: Saturday, July 08, 2017 12:30 PM
>> To: HW-news
>> Subject: RE: c:
>>
>> Mno,
>>
>> takze ak napisete presne tento riadok
>>
>> volatile unsigned char x = 0x0111 & 0xff;
>>
>> t.j. nie ziadne preprocesorove kuzla atd., tak Vam vyhodi tu chybu
>> aritmetickeho pretecenia presne na tomto riadku?
>>
>>
>> Dalej, v tom #if dole, ak je ten sucet vacsi ako 0x01ff, tak je vacsi aj
>> ako 0xff, t.j. vetva elif sa nikdy nezoberie do uvahy/
>>
>> Dalej, ak je ten sucet N a plati 0xff < N <= 0x1ff , tak ekvivalent toho N
>> & 0xff je N - 0x100 a nie 0xff - N.
>>
>>
>> wek
>>
>>
>>
>> ----- Original Message ---------------
>>
>> Subject: RE: c:
>>     From: "Miroslav Draxal" <evik na volny.cz>
>>     Date: Sat, 8 Jul 2017 12:17:03 +0200
>>       To: "'HW-news'" <hw-list na list.hw.cz>
>>
>>> Nikde, pøedpokládal jsem, že pokud výsledek souètu 3 bytu preprosecorem
>>> (max 0xff + 0xff + 0xff = 0x02fd) pøetypuji na(unsigned char) bude výsledek
>>> 0xfd - sice je, ale vyhodí varování.
>>>
>>> Pak jsem pøedpokládal že pokud provedu nad souètem and tak 0x02fd & 0xff
>>> bude výsledek 0xfd. Sice je, ale vyhodí varování.
>>> Proè?
>>>
>>> To s tím odeètem je podle mì taková berlièka.
>>> Míra
>>>
>>> -----Original Message-----
>>> From: Hw-list [mailto:hw-list-bounces na list.hw.cz] On Behalf Of Jan
>>> Waclawek
>>> Sent: Saturday, July 08, 2017 11:19 AM
>>> To: HW-news
>>> Subject: RE: c:
>>>
>>>> Vyoe1il jsem to takhle
>>>>
>>>> #if ((MeName0 + MeName1 + MeName2) > 0xff)
>>>>
>>>> #    define TxReSentTimerSet (0xff - MeName0 + MeName1 + MeName2)
>>>>
>>>> #elif ((MeName0 + MeName1 + MeName2) > 0x01ff)
>>>>
>>>> #    define TxReSentTimerSet (0x01ff - MeName0 + MeName1 + MeName2)
>>>>
>>>> #endif
>>>
>>>
>>> A kde presne v povodnej otazke mate to odcitanie?
>>>
>>> wek
>>>
>>> _______________________________________________
>>> HW-list mailing list  -  sponsored by www.HW.cz Hw-list na list.hw.cz
>>> http://list.hw.cz/mailman/listinfo/hw-list
>>>
>>> _______________________________________________
>>> HW-list mailing list  -  sponsored by www.HW.cz Hw-list na list.hw.cz
>>> http://list.hw.cz/mailman/listinfo/hw-list
>>
>> _______________________________________________
>> HW-list mailing list  -  sponsored by www.HW.cz Hw-list na list.hw.cz
>> http://list.hw.cz/mailman/listinfo/hw-list
>>
>> _______________________________________________
>> HW-list mailing list  -  sponsored by www.HW.cz
>> Hw-list na list.hw.cz
>> http://list.hw.cz/mailman/listinfo/hw-list
>
>
>
> _______________________________________________
> HW-list mailing list  -  sponsored by www.HW.cz
> Hw-list na list.hw.cz
> http://list.hw.cz/mailman/listinfo/hw-list


Další informace o konferenci Hw-list