|
|
Nieminen Mika wrote in message <3701c9cf.0@news.povray.org>...
>Johannes Hubert <jhu### [at] algonetse> wrote:
>: However, I would disagree with your second opinion:
>: Getting warnings is not a bad thing in general, because they are just
that:
>: "Warnings". They mean "Hey something here *might* be wrong, you're sure
you
>: wanna do this?" and you always have the choice (as in the given
situation)
>: to say "Yes, damn sure! ;-)"
>
> Perhaps in this case. However in C (and C++) a warning is almost always
>advisable and should be considered as an error message (this is what they
>have taught me and this is what I have seen by experience).
In general I agree with you.
Only sometimes warnings are just that. Especially this "union with only one
object" warning. I always felt it was rather useless. I can almost see how
this warning would have never been programmed if the programmer who did it
had felt a little less careful/paranoid that day ;-)
I once had a C++ project where there always showed up 2 warnings which I
knew exactly what they came from and why I could safely ignore them. After
some time I had grown fond of these two warnings ;-) and not seeing them
after a compile gave me a feeling of wrongness...
Anyway: Most C/C++ compilers allow you to specify warning-levels. For
example Visual C++ has 4 (I think) with 2 being the standard and 4 the most
restrictive. So by choosing (or agreeing) to the standard level of 2 I
actually say: Yes, I know there would have been additional warnings if I had
chosen level 4, but I am sure that I can ignore them...
Johannes.
Post a reply to this message
|
|
|
|
In C a warning usually means that I forgot to write the function
that was going to use that variable.
Cheers
Steve
Johannes Hubert wrote:
>
> Nieminen Mika wrote in message <3701c9cf.0@news.povray.org>...
> >Johannes Hubert <jhu### [at] algonetse> wrote:
> >: However, I would disagree with your second opinion:
> >: Getting warnings is not a bad thing in general, because they are just
> that:
> >: "Warnings". They mean "Hey something here *might* be wrong, you're sure
> you
> >: wanna do this?" and you always have the choice (as in the given
> situation)
> >: to say "Yes, damn sure! ;-)"
> >
> > Perhaps in this case. However in C (and C) a warning is almost always
> >advisable and should be considered as an error message (this is what they
> >have taught me and this is what I have seen by experience).
>
> In general I agree with you.
> Only sometimes warnings are just that. Especially this "union with only one
> object" warning. I always felt it was rather useless. I can almost see how
> this warning would have never been programmed if the programmer who did it
> had felt a little less careful/paranoid that day ;-)
>
> I once had a C project where there always showed up 2 warnings which I
> knew exactly what they came from and why I could safely ignore them. After
> some time I had grown fond of these two warnings ;-) and not seeing them
> after a compile gave me a feeling of wrongness...
>
> Anyway: Most C/C compilers allow you to specify warning-levels. For
> example Visual C has 4 (I think) with 2 being the standard and 4 the most
> restrictive. So by choosing (or agreeing) to the standard level of 2 I
> actually say: Yes, I know there would have been additional warnings if I had
> chosen level 4, but I am sure that I can ignore them...
>
> Johannes.
Post a reply to this message
|
|