xsharp.eu • Compiler switches
Page 1 of 1

Compiler switches

Posted: Thu Sep 22, 2022 3:12 pm
by Horst
Hallo
I compiled my project with the new 2.13 and now i have many warnings

Code: Select all

warning XS9021: Conversion from 'dword' to 'int' may lead to loss of data or overflow errors	482,13	Pdf Klasse.prg	MDPDF:_getstringwidth
i know i shoud clean up this prg's , but i did not wrote it and it will need a lot of time and they worked for years now.

in the attachements a picture of my compiler switches

Horst

Compiler switches

Posted: Thu Sep 22, 2022 3:16 pm
by Chris
Hi Horst,

If you just want to hide those warnings, you can just add its number (9021) in the list of already disabled warnings in the top of the screenshot you posted.

But of course it's better when you get some time, to resolve the warnings by modifying the code, since most warnings are probably harmless (the potential numeric overflow never happens in practice), but a few of them might be also revealing true existing problems in your app, which might be hidden till now.

Compiler switches

Posted: Thu Sep 22, 2022 3:57 pm
by Horst
Hello Chris

The warnings did not come before X# 2.10 , i am scared some switches is not working anymore.

Because this was not working
fTmp is a float ,gdMwst is dword - the result shoud be 7.7 but was 8

Code: Select all

fTmp :=  SELF:gdMwst1/100
i had to change to

Code: Select all

	fTmp :=  SELF:gdMwst1/100.0

Wolfgang told me that or setting a switch months ago - and /vo12 was set on

Horst

Compiler switches

Posted: Thu Sep 22, 2022 4:07 pm
by Chris
Hi Horst,

No, it was just a bug before that those warnings were incorrectly not being reported and were hidden by accident, now they do get reported, so you are aware of potential such problems in the code. The same warnings are being reported (unless explicitly disabled) also in VO, for the same code.

About the division problem, I'm not seeing it here, when /vo12 is on, then I do get 7.7 as a result. CAn you show a complete sample reproducing the problem?

Compiler switches

Posted: Fri Sep 23, 2022 6:06 am
by Horst
Hello Chris
I can not reproduce the error with x# 2.13. So i went back to the x# version before. Now i can say x# 2.13 works good and it was my version 2.10 before that make the error with the devision.

i dont like warnings :-) so i will spend time to fix all this int - dword warnings.

Thanks
Horst