Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
5
Erster Beitrag:
vor 8 Monaten, 1 Woche
Letzter Beitrag:
vor 8 Monaten, 1 Woche
Beteiligte Autoren:
Ola, Peter Holemans, Stefan Bentvelsen, Fabrice Harari

[WD21] How to fix "Overflow during assignment"?

Startbeitrag von Ola am 14.12.2016 20:39

I have one runtime warning in my app's dynamic audit,
"Overflow during assignment"
in the following code:

//StdColorBG is a global array of 24 4-byte unsigned int //Background colors
//These are constants, must not be translated.
StdColorBG = [White,DarkGray,LightRed,YellowToolhelp,DarkBlue,LightCyan, ...
Transparent,LightGray,DarkYellow,DarkGreen,LightBlue,DarkMagenta, ...
Black,DarkRed,LightYellow,LightGreen,DarkCyan,LightMagenta, ...
PastelRed,PastelYellow,PastelBlue,PastelCyan,PastelGreen,PastelMagenta]

Can somebody please explain, why, and what should I do to get rid of the warning?

Best regards
Ola

Antworten:

Hi Ola,

I get this kind of errors when the value of a 8-byte int is assigned to a int i.e.
You could try using an array of 24 8-byte int.

von Stefan Bentvelsen - am 14.12.2016 21:34
Hi Ola,

by any chance, are you testing in 64 bits?
If yes, any system integer (like the color value) would be stored as int on 8, not 4.

Best regards

von Fabrice Harari - am 14.12.2016 21:35
Hi Ola,

Use the 'is system int' declaration.
That way it will work on as well 32 as 64 bit systems.

Cheers,

Peter Holemans

von Peter Holemans - am 15.12.2016 08:01
Hi all,

Thanks you all for the answers.

I am developing in 32 bits, as I understand that WD might have some extra problems with 64 bits, and I already have more than my fair share of problems even with 32 bits.

I used Peter's instruction and re-specified the array as "system int", and that solved the problem.

Best regards
Ola

von Ola - am 15.12.2016 08:58
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.