fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: I like the stronger checks of the X# compiler

I like the stronger checks of the X# compiler 3 years 3 months ago #169

  wriedmann's Avatar Topic Author wriedmann Offline Posts: 1545
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
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

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

Last edit: by wriedmann.

I like the stronger checks of the X# compiler 3 years 3 months ago #176

  Chris's Avatar Chris Offline Posts: 1137
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.

I like the stronger checks of the X# compiler 3 years 3 months ago #179

  wriedmann's Avatar Topic Author wriedmann Offline Posts: 1545
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
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

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

  • Page:
  • 1