Re: pragma warning
- From: "Andrew McDonald" <myrmecophagavir@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 2 May 2005 00:12:08 +0100
"EggNChips" <address@xxxxxxxxxx> wrote...
> "Jeff F" <not@xxxxxxxxxxxx> wrote...
>> EggNChips wrote:
>>> Using Win98SE, VC6sp5,
>>>
>>> Keep getting the warning:
>>> C:\VC Programs\Presales\QuoteDetails.cpp(323) : warning C4700: local
>>> variable 'Status' used without having been initialized
>>>
>>> Even though I have #pragma warning ( disable : 4700 ) at the start of
>>> the function, this happens throughout my code. I don't like to have
>>> warnings.
>>>
>>> Am I missing something??????
>>
>> Yes, fix the problem it's warning about.
>
> thanks for the helpful post...............not. It is not an error, but a
> 'feature' of the particular function that I'm calling.
If the compiler thinks the variable could be used without initialisation, then it must be some
pretty complex (i.e. unreadable) code. How do you think humans are going to follow it, especially if
you have maintain it in 5 years' time (and *never* assume you won't)? You say you don't like to have
warnings, but if you just turn them off then they're still there without looking at the underlying
issue! Fixing your code will aid readability and possibly help anyone who comes to look at it in the
future. I'd be interested to see what code layout could cause such a warning without the programmer
caring at all about it though, regardless of how many brownie points you think anyone wants to
score.
Andrew
.
- Next by Date: Major Microsoft Visual C++ .NET Problems
- Next by thread: Re: pragma warning
- Index(es):
Loading