[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fixed mash problems with gcc 2.95.2
I fixed several files to work with the newest version of gcc 2.95.2.
This fixes the problem that Tim had. Most of the changes were from
the fact that what used to be warnings in older versions of gcc are
now errors. The following types of errors were fixed:
1. function references now require an & when creating a pointer to a
function
method = Grabber::grab // doesn't work
method = &Grabber::grab // ok
2. inline functions must explicitly state the type
inline hello() // doesn't work
inline int hello() //ok
3. c++ operator overloading requires a return type
operator ==(...) // doesn't work
int operator ==(...) // ok
4. const variables require a type
const foo = 6; // doesn't work
const int foo = 6; // ok
5. string constants in ? statements return type const char*, not
char*; if the result is passed to a function that expects char*,
gcc wil produce an error
((justify_==MBv2Justify) ? "right" :"left")); // doesn't work
((justify_==MBv2Justify) ? (char*)"right" : (char*)"left")); // ok
6. linux uses socklen_t for calls to getsockname(), etc., and
socklen_t is an unsigned int; in other systems, it's just an int
and gcc complains about signedness changes
In the future, try to remove all compiler warnings before checking in
code. That way if those warnings become errors in future versions of
gcc, things won't break (and most warnings are valid anyway).