Compiler switches

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

Compiler switches

Post 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
Attachments
compiler.jpg
compiler.jpg (151.32 KiB) Viewed 537 times
User avatar
Chris
Posts: 4899
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Compiler switches

Post 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.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

Compiler switches

Post 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
User avatar
Chris
Posts: 4899
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Compiler switches

Post 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?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

Compiler switches

Post 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
Post Reply