Re: A fix for gcc -Wconversion warning in glibmm




El Apr 25, 2010, a las 9:20 AM, Alexander Shaduri <ashaduri gmail com> escribió:


Hello all,

I'm not sure if I should open a bug report for such a simple patch,
so I'm going to post it here instead (please advise on how to handle
this in the future).

Basically, this fixes the annoying gcc warning in glibmm when
-Wconversion is used:
/usr/include/glibmm-2.4/glibmm/timeval.h: In member function ‘double Glib::TimeVal::as_double() const’: /usr/include/glibmm-2.4/glibmm/timeval.h:160:62: warning: conversion to ‘double’ from ‘long int’ may alter its value

Tested with gcc 4.5.0.
I'm attaching a patch (against glibmm master) which fixes the
warning by making an explicit cast where an implicit one was
being made.

As simple as it might be, filing it in bugzilla would ensure that it is not forgotten.

--
José


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]