fbpx

I like the stronger checks of the X# compiler

  • Wolfgang Riedmann
  • Wolfgang Riedmann's Avatar Topic Author
  • Offline
More
2 years 10 months ago - 2 years 10 months ago #1 by Wolfgang Riedmann
I like the stronger checks of the X# compiler was created by Wolfgang Riedmann
Hi,

compiling this code:
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
Last edit: 2 years 10 months ago by Wolfgang Riedmann.

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #2 by Chris Pyrgas
Replied by Chris Pyrgas on topic I like the stronger checks of the X# compiler
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

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

  • Wolfgang Riedmann
  • Wolfgang Riedmann's Avatar Topic Author
  • Offline
More
2 years 10 months ago #3 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic I like the stronger checks of the X# compiler
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

Please Log in or Create an account to join the conversation.