Re: change variables
- From: "Richard" <riplin@xxxxxxxxxxxx>
- Date: 10 Jul 2006 12:32:11 -0700
Michael Wojcik wrote:
In COBOL, true, but not in C, where the scope of a label is the
enclosing function.
That's probably true but I never needed to know that having never used
goto in C.
Obviously that doesn't help when we wish to read a program that *does*
abuse GO TO, but then neither does proscribing it.
The problem is knowing whether it does abuse GO TO or not, and whether
that is deliberate or accidental. If there _is_ a GO TO anywhere then
one has to check that there is no abuse.
It is similar to when there was an ALTER in the program. No GO TO could
ever be trusted until the whole program was checked, and then those
paragraphs referenced could never be trusted at any time.
Get rid of the ALTER and days of checking just disappears, those checks
are just not needed anymore. Get rid of GO TO, SECTION, THRU, and EXIT
...., and another chunk of code checking is just not needed.
I do agree that a mechanism for restricting the scope of labels to
something smaller than a program would be useful.
Not only the scope but also the usage. In C a function cannot be
dropped into, it can only be executed, a label can only be the target
of a goto (implied in a switch). If labels could be designated as only
a target of perform (no drop thru or goto) or only the target of a goto
(no drop thru or perform) then many types of errors could be found by
the compiler.
.
- References:
- change variables
- From: jferreira80
- Re: change variables
- From: Richard
- Re: change variables
- From: Michael Wojcik
- change variables
- Prev by Date: Re: Help with running IBM-COBOL ver 1.0 on Windows 2000/XP
- Next by Date: Re: No Compiler Warning in Cobol MicroFocus
- Previous by thread: Re: change variables
- Next by thread: Re: change variables
- Index(es):
Relevant Pages
|