Giter Site home page Giter Site logo

VS2015 warnings about nanosvg HOT 5 CLOSED

memononen avatar memononen commented on August 26, 2024
VS2015 warnings

from nanosvg.

Comments (5)

memononen avatar memononen commented on August 26, 2024

The warnings about nanosvg/rast.h looks sane things to fix.

I really really really hate the warnings about NSVG_NOTUSED. A new compiler, and we're back to square one again, and again.

If upstream stb_image_write fixes the warnings, let's update, else just leave it as is.

Thanks for taking the time to improve the code!

from nanosvg.

jry2 avatar jry2 commented on August 26, 2024

Could you please check this version in Xcode? It compiles without warnigs with GCC 4.7.2 and VC2015 RC.

#define NSVG_NOTUSED(v) ((void)(v))

from nanosvg.

jry2 avatar jry2 commented on August 26, 2024

Upstream stb_image_write.h is even worse than your version ;-) I will patch only nanosvg.h and nanosvgrast.h warnings.

1>e:\source\nanosvg\example\stb_image_write.h(210): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>  c:\program files (x86)\windows kits\10\include\10.0.10056.0\ucrt\stdio.h(205): note: see declaration of 'fopen'
1>e:\source\nanosvg\example\stb_image_write.h(329): warning C4457: declaration of 'comp' hides function parameter
1>  e:\source\nanosvg\example\stb_image_write.h(278): note: see declaration of 'comp'
1>e:\source\nanosvg\example\stb_image_write.h(372): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>  c:\program files (x86)\windows kits\10\include\10.0.10056.0\ucrt\stdio.h(205): note: see declaration of 'fopen'
1>e:\source\nanosvg\example\stb_image_write.h(553): warning C4456: declaration of 'i' hides previous local declaration
1>  e:\source\nanosvg\example\stb_image_write.h(476): note: see declaration of 'i'
1>e:\source\nanosvg\example\stb_image_write.h(554): warning C4456: declaration of 'j' hides previous local declaration
1>  e:\source\nanosvg\example\stb_image_write.h(476): note: see declaration of 'j'
1>e:\source\nanosvg\example\stb_image_write.h(702): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

from nanosvg.

memononen avatar memononen commented on August 26, 2024

I have used that unused macro before, and cannot remember anymore why I changed that. It might have been gcc with tighter warning level.

from nanosvg.

jry2 avatar jry2 commented on August 26, 2024

Some warnings are fixed in #42
I didn't fix following warnings:

1>E:\Source\nanosvg\src\nanosvg.h(120): warning C4201: nonstandard extension used: nameless struct/union
1>E:\Source\nanosvg\src\nanosvg.h(359): warning C4201: nonstandard extension used: nameless struct/union
1>E:\Source\nanosvg\src\nanosvg.h(730): warning C4127: conditional expression is constant
1>E:\Source\nanosvg\src\nanosvg.h(2487): warning C4127: conditional expression is constant
1>E:\Source\nanosvg\src\nanosvg.h(2488): warning C4127: conditional expression is constant

C4201 nonstandard extension used should be probably fixed in VC project, because anonymous structures and unions are valid in C11.
C4127 conditional expression is constant is problematic NSVG_NOTUSED macro.

from nanosvg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.