Re: null terminated strings



Tom Linden wrote:
On Fri, 10 Feb 2006 12:15:04 -0500, Dave Froble <davef@xxxxxxxxxxxxx> wrote:

Well, it can be caught by the compiler. I have utilities that will parse the /LIST output of the compiler, and report on variables that are referenced only once. I can then check out such, and determine whether it's a typo, or something brought in with some boiler-plate sections of code.


If you use a _real_ compiler it does it for you
PLI

/CROSS_REFERENCE

/NOCROSS_REFERENCE (D)

Specifies whether the compiler is to generate cross references in
the listing file. If you specify /CROSS_REFERENCE, the compiler
lists, for each variable referenced in the procedure, the line
numbers of the lines on which the variable is referenced.

You must specify /LIST/SHOW=MAP with /CROSS_REFERENCE.


So does VAX Basic. A utility can check the cross reference, and when a variable has only one reference, it's time for a look at that section of code. Also, nearby in the cross reference may be another variable with similar spelling, and that's an indicator that perhaps there is a typo.

Any of the VMS compilers that I've seen, and the list is far from complete, will generate the cross reference.

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. Fax: 724-529-0596
DFE Ultralights, Inc. E-Mail: davef@xxxxxxxxxxxxx
170 Grimplin Road
Vanderbilt, PA 15486
.



Relevant Pages

  • Re: List<> of struct with property. Cannot change value of property. why?
    ... method changes the struct that owns it. ... how would the compiler know the method changes the struct? ... Should the linker be required to carry this flag around too, so that when you import a reference to a struct type not compiled with the current project, you still have that information? ... There's a time and place for a value type, and in fact they even have their place in lists. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Using early-bound interface on a late-bound object
    ... > the compiler determines which interfaces to use, ... > supports the declared interface. ... >> help if someone can point me to some authoritative document or reference ... within customer shops when they mirrored this 'division' to keep their ...
    (microsoft.public.vb.general.discussion)
  • Re: List<> of struct with property. Cannot change value of property. why?
    ... method changes the struct that owns it. ... so that when you import a reference to a struct type not ... tell it specifically that it doesn't change it, then the compiler ... have their place in lists. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Garbage Collection Eligibility and portability
    ... (in the parlance of compiler writers). ... There isn'tany way to get a given Lisp to act that way. ... that alters exactly when a variable reference to a memory location ceases holding it from collection. ... The other, which I've seen called "Aggressive garbage collection" in some articles on this behavior in C#/.Net, appears to make a memory location eligible the instant the last reference to the location is used. ...
    (comp.lang.lisp)
  • Re: Why we should (not?) have closures after all
    ... Programmers should have tools that can tell them as much as possible about their code's likely behavior. ... The wart can be used anywhere a type is used in declaring a reference ... The compiler does nothing special if a "can be null" reference is ... it would be nice if there was a variant of the "assert" statement that was always enabled and threw IllegalArgumentException instead of AssertionError. ...
    (comp.lang.java.programmer)