Re: self-confidence of compiler

Tech-Archive recommends: Fix windows errors by optimizing your registry



Nicholas Paldino [.NET/C# MVP] <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
While yes the jobId will never be accessed, it is beyond the compiler to
figure it out.

What you are looking for is static analysis of the code, something way
beyond (and usually very computationally intensive) what a compiler is
expected to do.

Short answer, you are right, it shouldn't give you grief about this,
unfortunately, the compiler would have to expend a severe amount of
processing power and time to figure this out.

Perhaps more importantly than the processing power (at least in my
view) - to specify the *exact* behaviour here, i.e. what the compiler
must be able to work out - would make the C# language specification
huge compared with its current form.

The rules for definite assignment are currently incredibly tedious, but
at least they're reasonably clear. Putting in a lot of static analysis
requirements would make it a lot harder to understand what we *should*
be able to expect, and to verify that a compiler did the right thing.

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.



Relevant Pages

  • Re: How to avoid undesired default values?
    ... are documented in the documentation that comes with your compiler. ... of why static analysis for uninitialized variables does no work. ... This is why the good complete checking for uninitialized variables is done ...
    (comp.lang.fortran)
  • Re: Segfault only with optimization
    ... Realise that output is not the only measure of correctness. ... To KNOW that there is a buffer overrun the program MUST ... Static analysis is when you analyse the code *without* running it. ... compiler warnings or errors). ...
    (comp.lang.c)
  • Re: subroutine stack and C machine model
    ... was your canonical non-syntactic distinction. ... What matters to a compiler is what can ... did some static analysis on it and fixed all the memory leaks, ...
    (comp.lang.c)
  • Re: Runtime optimizations
    ... >> done based on static analysis of the code when it's first compiled. ... > involve file I/O, which is slow relative to JIT compile time. ... > compiler were separated nicely like FLINT, ... ; "There is no dark side of the moon really; matter of fact, ...
    (comp.lang.lisp)
  • Re: Visual C++ 2005 and the ECMA C++/CLI standard
    ... All of the features in the language specification are in the product. ... 'generic' keyword whereas the compiler does. ... boxing as a standard conversion, and the compiler treats boxing as a special ... Again, if you have any influence on Microsoft, it would be nice if you would encourage Microsoft to publish even these subtle differences so that C++/CLI programmers could know ...
    (microsoft.public.dotnet.languages.vc)