Re: Check on correctness



I haven't upgraded to VS2005 yet, since I haven't been in town long enough to do anything
serious except try to meet deadlines. But I approve of any compiler that refuses to
accept embedded assignments. I'm one of those people who, for serious projects, not only
sets warning level 4, but also selects the option that warning==error. A compilation with
warnings is not acceptable.

I have found lint (I use gimpel lint) to be one of the best diagnostics to run on code I'm
given. I can find 10-20 bugs just from the lint listings on any reasonably-sized
(50K-150K lines) project. I just wish C were even more hard-nosed about diagnostics, such
as forbidding the use of int where bool is required.
joe

On Wed, 5 Jul 2006 12:08:08 -0700, "Tom Serface" <tserface@xxxxxxx> wrote:

I don't know if planes have crashed, but ... I can't tell you how much I
appreciate the new level of warnings we get with 2005. I think it's worth
upgrading just for that alone. The first time I compiled some code we had
here it pointed out a number of things that most of the time worked, but
had a chance of not working... you know the kind of stuff. Needless to say
I fixed the potential problems and was happy to get the additional warnings.

Tom

"Sgt. York" <york@xxxxxxxxxxxxxx> wrote in message
news:ILCdnQjTouuemTHZnZ2dnUVZ_vqdnZ2d@xxxxxxxxxxxxxxxxxx
It's also been set right by my compiler to provide a warning. No need to
jump ship to Mister-JIT-Massive-Runtime just yet.

Ian Semmel wrote:
One of the big mistakes in the design of C++ was to make it accept C
code.

Statements like if ( a = b ) mistakenly written for if ( a == b ), have
probably caused planes to crash.

It has been set right in C#.

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Spirit rover OS problems ( a reliable language )
    ... > problems than any C compiler I used 20 years ago, ... >>What occurs in real life is that you get massive amounts of warnings. ... that does not exist in the C language. ... I don't doubt that your lint program is very impressive to you. ...
    (comp.arch.embedded)
  • Re: Prototype or not prototype?
    ... compile the code with a C++ compiler. ... Some people would have used "lint" for such things. ... case essentially all "lint" warnings indicate something ... written code generates so many warnings when "lint"ed that ...
    (comp.std.c)
  • Re: how to let gcc warn me when I use = in conditions
    ... running your code through lint and using ... be alert to safety problems, not assuming a sense of safety that isn't ... If you are compiling to one compiler that specifically covers this, ... warnings I would like it to. ...
    (comp.lang.c)
  • Re: splint for c++?
    ... The problem with using the compiler, ... > warnings are, is that it will only check one compilation unit at a time, ... > whereas lint checks all the files given to it as a unit. ...
    (comp.unix.programmer)
  • Re: Is it standard and practical to use long long types?
    ... > right option for putting the compiler in conforming mode. ... > compiler is invoked with the extensions disabled, ... Bogus/idiotic warnings when all warnings are enabled. ... GCC does not fully support C99, yet ansi invokes it's C99 spirit. ...
    (comp.lang.c)

Loading