Hallo,
ich steige gerade von AVR Studio auf Codevision um. Dazu passe ich
meinen Code, der in AVR Studio ohne Fehler lief, an.
Hier ein Codestück
1 | ...
|
2 | unsigned char x_pos;
|
3 | unsigned char y_pos;
|
4 | int position;
|
5 | ...
|
6 | position = y_pos*126 + x_pos*6;
|
7 | ...
|
Bei Codevision bringt er nun folgende Fehlermeldung für den Code:
"overflow is possible in 8-bit multiplication, casting may be required"
und
"overflow is possible in 8-bit addition, casting may be required"
Die Warnung bleibt auch bei long int.
Ich weiß das:
y_pos<=15 und x_pos <=21 somit wäre postion<=2016!!!
Gruß Daniel