On Sat, Jan 17, 2009 at 12:37 AM, Mindaugas Kavaliauskas
<dbto...@dbtopas.lt> wrote:

> In Harbour variables are (kind of) assigned to NIL on its' defnintion, and
> this fact is often used by programmers. We often do, something like:
>
>  LOCAL xI
>  FOR nI := 1 TO ..
>     IF xI == NIL  // xI is unassigned on first cycle of the loop
>         ...
>     ENDIF
>     ...
>  NEXT
> ...
> So, I do not want to do a partial implementation of this based on pcode
> analysis.

I have seen how useful has been -w3 to detect bad code like:

function lookup
.....
cOldAlias = alias()
select cNewAlias
.....
<miss to restore the saved alias>
return

I understand it could also warn valid code but I still think it could
be useful to have it maybe as separate switch like ( -w3U or -wu ) to
detect "possible" rt errors.

Clearly typed vars would be a more definitive solution but it also
will require a big change in the code, instead this could be a "run
once" switch to use with -w3 to clean and check existing code.

best regards,
Lorenzo







so it could be also useful to check where giving a look but now after
deleting many unused assignments
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to