compiler warnings in base
Jeffrey O. Hill wrote:
> There are many different compilers - and many different compiler
> versions. They all produce a different set of warnings. Compounding
> this is C++, and a lack of maturity related to what requires a warning
> and what doesnt and the relative verbosity of C++ warnings.
> I fix all warnings I see, but doubt that I can ever keep up with all
> of it - at least not instantaneously.
True. The later the compiler version number, the more warnings or even
errors. But that is the result of using the -pedantic flag ;-)
On Linux, there are very few warnings, but when I tried to build EPICS
on Windows, I found many (and different for cygwin gcc and the M$ compiler).
The problem with nonrelevant warnings is that you can't find the
relevant warnings any more.
I have built 2 patches so far for two major (nonrelevant) warnings:
1) "ISO C forbids conversion of function pointer to object pointer type"
This is a warning from cygwin gcc 3.4.4. It appears very often and means
"Thou shalt not store a function pointer in a void*".
I guess the reason is that the size of a function pointer might be
different from the size of a data pointer on some architectures. Thus it
is a portability problem. Of course it is not a problem on today's
standard architectures (PPC, x86, 68k).
I have attached a fix for this (funcPtrWarning
It basically changes in gpHash.h
void (*func) ();
2) Type mismatch
The Mirco$oft cl complains a lot about type mismatch. It is mainly
signed/unsigned comparision and implicit casts to "smaller" datatypes,
also a few const/non-const casts.
The fix (typeMismatchPatch) handles that.
Please have a look at both patches if your time allows and check if I
broke someting. They are against the CVS snapshot from October 6.
There are still a few more warnings (which might be more meaningful). I
will have a look at those.
> This is probably not a mantis issue unless the problems appear to be
> liekly to cause a failure.
Most likely not.
> Otherwise, you could send me an e-mail if the problem appears to be
Not really "pressing". I just don't like to ignore warnings.
Dr. Dirk Zimoch
Swiss Light Source
Paul Scherrer Institut
Computing and Controls
phone +41 56 310 5182
fax +41 56 310 4413
Original Mantis Bug: mantis-219
|Changed in epics-base:|
|status:||Fix Committed → Fix Released|