-   Programming (
-   -   How to suppress particular warning message? (

hottdogg 02-22-2007 12:09 AM

How to suppress particular warning message?
How to suppress warning something like this:

warning: passing `float' for argument 4 of `virtual void
  QPushButton::setGeometry(int, int, int, int)'

in g++ 3.2.3 ?


MegaFighterX 02-22-2007 02:01 AM

Do you need it to be a float there? if that's the case, change the last bit to QPushButton::setGeometry(int, int, int, float).

Otherwise, if you just need the value there (minus the decimal places), just cast it (usually (type)(varname)).

What exactally do you need for that last variable?

hottdogg 03-01-2007 01:21 AM

I'm working on someone else's code with lots of warning.The one that I asked has been fixed.
But there are some inevitable warnings and I want to supress these.
such as:

assignment to `int' from `double'
argument to `int' from `double'

MegaFighterX 03-02-2007 01:15 AM

I can understand why... But casting it should eliminate the warning...

I don't see why it's throwing a warning when going from a smaller number set to a larger one though... that's odd.

All times are GMT -5. The time now is 03:05 AM.