FLTK logo

Re: [fltk.coredev] RFC: Disable Visual Studio warning about

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: RFC: Disable Visual Studio warning about imm Feb 22, 2021  
 
On Mon, 22 Feb 2021, 10:59 Manolo wrote:
There remain a few VisualStudio warnings coming from file nanosvg.h which
gets included by Fl_SVG_Image.cxx when building libfltk_images :

1>…\fltk\src\../nanosvg/nanosvg.h(1433,12): warning C4244: 'initialisation' : conversion of 'double' to 'float', possible data loss
1>…\fltk\src\../nanosvg/nanosvg.h(1441,12): warning C4244: 'initialisation' : conversion of 'double' to 'float', possible data loss
1>…\fltk\src\../nanosvg/nanosvg.h(1474,26): warning C4244: '=' : conversion of 'double' to 'float', possible data loss
1>…\fltk\src\../nanosvg/nanosvg.h(2517,29): warning C4244: '=' : conversion of 'double' to 'float', possible data loss
1>…\fltk\src\../nanosvg/nanosvg.h(2521,29): warning C4244: '=' : conversion of 'double' to 'float', possible data loss
1>…\fltk\src\../nanosvg/nanosvg.h(2525,30): warning C4244: '=' : conversion of 'double' to 'float', possible data loss
1>…\fltk\src\../nanosvg/nanosvg.h(2529,31): warning C4244: '=' : conversion of 'double' to 'float', possible data loss


What about adding in our own nanosvg branch an extra "pragma warning" to the 2 already present in nanosvg.h and obtain

#ifdef _MSC_VER
    #pragma warning (disable: 4996) // Switch off security warnings
    #pragma warning (disable: 4100) // Switch off unreferenced formal parameter warnings
    #pragma warning (disable: 4244) // Switch off implicit type conversion warnings  <---- this would be added

Alternatively, would adding explicit casts work to silence the warning?

I think an explicit cast (if it works!) would be "better" than turning off the warning with the pragma. Maybe...

-- 
Ian
From my Fairphone FP3

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/CAGFM6dZi2sfJ9Y9NKL%3D_TV3m0oAH1rht3dT4gcurSFEegUykKw%40mail.gmail.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.