xsharp.eu • I like the stronger checks of the X# compiler
Page 1 of 1

I like the stronger checks of the X# compiler

Posted: Wed Feb 24, 2016 1:19 pm
by wriedmann
Hi,

compiling this code:

Code: Select all

nLen := oParameter:Count - 1
for nI := 0 upto nLen                                                   
  cKey:= cKey
  cParameter:Replace( "@" + cKey + "@", oParameter[cKey] )
next
gave me the compiler warnings

warning XS1717: Assignment made to same variable; did you mean to assign something else?
warning XS0165: Use of unassigned local variable 'cKey'

and in fact, the compiler is right!

Thank you for discovering such (stupid) errors!

Wolfgang

I like the stronger checks of the X# compiler

Posted: Wed Feb 24, 2016 11:36 pm
by Chris
Hi Wolfgang,

Actually the X# compiler found this exact problem also in my old VIDE code, about a dozen times! In all cases it was of course bugs in my code that were not caught by the vulcan compiler earlier and were causing incorrect runtime behavior, was embarrassing to realize this after all that time :-)

There were more similar problems in my code (about 135k lines) that were pointed out by the X# compiler, I want to find some time and write a blog article about this.

Chris

I like the stronger checks of the X# compiler

Posted: Thu Feb 25, 2016 7:06 am
by wriedmann
Hi Chris,

new and stronger compilers help us programmers to write more stable programs - I like them.

Thanks to your team for this check!

Wolfgang