Re: What warnings in r38007 require casting int const to double?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: What warnings in r38007 require casting int const to double?

Kurt Schwehr-2
+gdal-dev

On Wed, May 17, 2017 at 7:12 AM, Kurt Schwehr <[hidden email]> wrote:
Hi Even,

Do you remember what warning by which compiler with this changeset?

Thanks,
-kurt

"Message: Fix warnings about alteration of constant value"

          if( dfDoubleRet > static_cast<double>(
                                            std::numeric_limits<int>::max()) ||
              dfDoubleRet < static_cast<double>(
                                            std::numeric_limits<int>::min()) ||




--

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: What warnings in r38007 require casting int const to double?

Even Rouault-2

On mercredi 17 mai 2017 07:13:39 CEST Kurt Schwehr wrote:

> +gdal-dev

>

> On Wed, May 17, 2017 at 7:12 AM, Kurt Schwehr <[hidden email]> wrote:

> > Hi Even,

> >

> > Do you remember what warning by which compiler with this changeset?

 

Hum of course not :-) It might be some older compiler/distribution I tested before releasing 2.2.

 

I don't see indeed in the part you quote below why a compiler would complain.

 

But in the changeset the change related to GUIntBig is legitimate since big values of 64 bit integers cannot be exactly represented as a 64 bit double.

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: What warnings in r38007 require casting int const to double?

Kurt Schwehr-2
Ok. I will try reverting just those casts today and if it break travis, I will put them back with a comment as to why

On May 17, 2017 7:34 AM, "Even Rouault" <[hidden email]> wrote:

On mercredi 17 mai 2017 07:13:39 CEST Kurt Schwehr wrote:

> +gdal-dev

>

> On Wed, May 17, 2017 at 7:12 AM, Kurt Schwehr <[hidden email]> wrote:

> > Hi Even,

> >

> > Do you remember what warning by which compiler with this changeset?

 

Hum of course not :-) It might be some older compiler/distribution I tested before releasing 2.2.

 

I don't see indeed in the part you quote below why a compiler would complain.

 

But in the changeset the change related to GUIntBig is legitimate since big values of 64 bit integers cannot be exactly represented as a 64 bit double.

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: What warnings in r38007 require casting int const to double?

Even Rouault-2

On mercredi 17 mai 2017 07:50:23 CEST Kurt Schwehr wrote:

> Ok. I will try reverting just those casts today and if it break travis, I

> will put them back with a comment as to why

 

I don't think this will break Travis since that comes from changesets you introduced days/weeks before, so we would have noticed. I likely noticed when compiling in some VM. I should have noted the compiler. I don't think this was a compilation error, but just a warning about loss of precision.

 

>

> On May 17, 2017 7:34 AM, "Even Rouault" <[hidden email]> wrote:

> > On mercredi 17 mai 2017 07:13:39 CEST Kurt Schwehr wrote:

> > > +gdal-dev

> > >

> > > On Wed, May 17, 2017 at 7:12 AM, Kurt Schwehr <[hidden email]> wrote:

> > > > Hi Even,

> > > >

> > > >

> > > >

> > > > Do you remember what warning by which compiler with this changeset?

> >

> > Hum of course not :-) It might be some older compiler/distribution I

> > tested before releasing 2.2.

> >

> >

> >

> > I don't see indeed in the part you quote below why a compiler would

> > complain.

> >

> >

> >

> > But in the changeset the change related to GUIntBig is legitimate since

> > big values of 64 bit integers cannot be exactly represented as a 64 bit

> > double.

> >

> >

> >

> > Even

> >

> >

> >

> > --

> >

> > Spatialys - Geospatial professional services

> >

> > http://www.spatialys.com

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev