Re: Something is stepping on something



In article <61j175F1svdtbU1@xxxxxxxxxxxxxxxxxx>,
Paul Russell <prussell@xxxxxxxxx> wrote:

Robert Peirce wrote:

Folks, please give me a break. This stuff is legacy software, written
over 30 years ago and changed only enough to port it to new machines.
In this case I did make that change and the code works properly

[resume snipped]


It wasn't meant to be a criticism, just a suggestion. You should never
assume anything about the layout of variables in memory - it can change
not only between different machines and different compilers but also
between different builds (e.g. if you change compiler switches). Rather
than repeatedly "fixing" these problems on an ad hoc basis you could
just invest a little time making the code more robust - it would
probably be a net win in the long run.

I second both the "it is just a suggestion", and the "still, I repeat
that suggestion" parts. This does not have to mean staring for hours at
the source. There are tools that can help here, such as clint
(<http://sourceforge.net/projects/clint/>) and/or valgrind
(<http://valgrind.org/>) variant. The things these tools report might
even help you solve some "it crashes once in a while", "the results look
odd once in a while" or "it does not work when I enable compiler
optimization" issues.

Reinder
.



Relevant Pages

  • Re: Partial string loss with sprintf/strcat
    ... As already suggested collecting information about the ... The stack and heap size ... A good suggestion but it's been years since I inspected assembler level ... compiler" that compiles to EM byte-code. ...
    (comp.lang.c)
  • Re: Source code size and debug disabled
    ... different to the C++ compiler, could this be a feature introduced by the ... My suggestion would be to split the one huge file down into a number of more ... feature of producing a lib rather than a dll. ... >> After the limit source line information is not available. ...
    (microsoft.public.vc.debugger)
  • Re: Help needed for programming of microcontrollers and associated chips.
    ... Repeat the check for any new loops you see. ... Write source code for some of the subsections and code to test those ... Now you need a compiler. ... Fix everything that the compiler warned you about. ...
    (sci.electronics.design)
  • Re: Girl Genius 8.7.09
    ... doesn't fix losing ")" (in Google Groups) from the address. ... repeat the suggestion of substituting %29, ...
    (rec.arts.sf.written)
  • Re: Help with running IBM-COBOL ver 1.0 on Windows 2000/XP
    ... IBM Personal Computer COBOL Compiler ... the byte immediately before this string and verify that it is 01 before ... copies of the files if this suggestion fails. ...
    (comp.lang.cobol)