From: Scott Lurndal on
Edgardo Portal <egportal2002(a)yahoo.com> writes:
>On 2010-03-04, Nicolas George <nicolas$george(a)salle-s.org> wrote:
>> John Gordon wrote in message <hmokvi$53g$1(a)reader1.panix.com>:
>>> No, it does actually do something: it will throw a compile error if you
>>> mistype == as =.
>>
>> Any half-decent compiler can throw a warning for that.
>
>But warnings can be missed, ignored, etc., while the
>compilation error must be attended to (to succesfully
>compile, at least).

gcc has -Wall and -Werror. Both are recommended.

Production code should never have compilation warnings.

scott
From: news.telesweet.net on
On 3/4/2010 12:47 PM, Nicolas George wrote:
> Edgardo Portal wrote in message
> <hmor5u$8r2$1(a)news.eternal-september.org>:
>> But warnings can be missed, ignored, etc., while the
>> compilation error must be attended to (to succesfully
>> compile, at least).
>
> And people can also purposefully edit the source to add bugs.
>
> If the programmer is trying to make a good, working program, it enables most
> warnings and tries to correct them all.

This isn't always feasible, especially when the code throwing the
warnings doesn't belong to you. On the project I currently work for
it invariably occurs that when I compile a package I end up getting
hundreds of warnings from the various packages it depends on.
Sifting through all those warnings looking for one that might have been
added by the code I modified is simply infeasible. An error, on the
other hand, stands out much better, and must be fixed for the code to
compile.

--
Dan Giaimo
From: Edgardo Portal on
On 2010-03-04, Scott Lurndal <scott(a)slp53.sl.home> wrote:
> Edgardo Portal <egportal2002(a)yahoo.com> writes:
>>On 2010-03-04, Nicolas George <nicolas$george(a)salle-s.org> wrote:
>>> John Gordon wrote in message <hmokvi$53g$1(a)reader1.panix.com>:
>>>> No, it does actually do something: it will throw a compile error if you
>>>> mistype == as =.
>>>
>>> Any half-decent compiler can throw a warning for that.
>>
>>But warnings can be missed, ignored, etc., while the
>>compilation error must be attended to (to succesfully
>>compile, at least).
>
> gcc has -Wall and -Werror. Both are recommended.
>
> Production code should never have compilation warnings.
>
> scott

That can be hard to adhere to in practice, particularly if
you're using a lot of 3rd-party code.
From: Casper H.S. Dik on
"news.telesweet.net" <dgiaimo(a)gmail.com> writes:

>This isn't always feasible, especially when the code throwing the
>warnings doesn't belong to you. On the project I currently work for
>it invariably occurs that when I compile a package I end up getting
>hundreds of warnings from the various packages it depends on.
>Sifting through all those warnings looking for one that might have been
>added by the code I modified is simply infeasible. An error, on the
>other hand, stands out much better, and must be fixed for the code to
>compile.

And then there's "diff"; if you compile your own code (new code should
add warnings) and other code, then it should be possible to filter out
the "new" warnings. It is part of our standard practice.

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
From: Jonathan de Boyne Pollard on
>
>
> But this really only means that average people well-versed in
> mathematics shouldn't attempt to code in C because they will likely
> make basic errors other people wouldn't.
>
I'm sure that they'll be delighted to hear that it's their fault for
being mathematicians, and not the C language's fault.

First  |  Prev  |  Next  |  Last
Pages: 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
Prev: integer
Next: shared memory question