Telroshan / go-sfml

Up-to-date Go bindings for SFML, the Simple and Fast Multimedia Library.
MIT License
144 stars 16 forks source link

A lot of compilation warnings on Ubuntu 20.04 #6

Open Ledmington opened 2 years ago

Ledmington commented 2 years ago

I started using your project inside mine, a porting in go of a N-bodies simulation. When i run go build or go test or go run i get all these compilation warnings:

# gopkg.in/teh-cmc/go-sfml.v24/graphics
Graphics_wrap.c: In function ‘_wrap_sfRenderWindow_capture_graphics_23698568018502eb’:
Graphics_wrap.c:5697:3: warning: ‘sfRenderWindow_capture’ is deprecated [-Wdeprecated-declarations]
 5697 |   result = (sfImage *)sfRenderWindow_capture((struct sfRenderWindow const *)arg1);
      |   ^~~~~~
In file included from /usr/include/SFML/Graphics.h:46,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/RenderWindow.h:556:46: note: declared here
  556 | CSFML_GRAPHICS_API CSFML_DEPRECATED sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow);
      |                                              ^~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setFloatParameter_graphics_23698568018502eb’:
Graphics_wrap.c:6405:3: warning: ‘sfShader_setFloatParameter’ is deprecated [-Wdeprecated-declarations]
 6405 |   sfShader_setFloatParameter(arg1,(char const *)arg2,arg3);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:421:42: note: declared here
  421 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloatParameter(sfShader* shader, const char* name, float x);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setFloat2Parameter_graphics_23698568018502eb’:
Graphics_wrap.c:6426:3: warning: ‘sfShader_setFloat2Parameter’ is deprecated [-Wdeprecated-declarations]
 6426 |   sfShader_setFloat2Parameter(arg1,(char const *)arg2,arg3,arg4);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:444:42: note: declared here
  444 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setFloat3Parameter_graphics_23698568018502eb’:
Graphics_wrap.c:6449:3: warning: ‘sfShader_setFloat3Parameter’ is deprecated [-Wdeprecated-declarations]
 6449 |   sfShader_setFloat3Parameter(arg1,(char const *)arg2,arg3,arg4,arg5);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:468:42: note: declared here
  468 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setFloat4Parameter_graphics_23698568018502eb’:
Graphics_wrap.c:6474:3: warning: ‘sfShader_setFloat4Parameter’ is deprecated [-Wdeprecated-declarations]
 6474 |   sfShader_setFloat4Parameter(arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:493:42: note: declared here
  493 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setVector2Parameter_graphics_23698568018502eb’:
Graphics_wrap.c:6500:3: warning: ‘sfShader_setVector2Parameter’ is deprecated [-Wdeprecated-declarations]
 6500 |   sfShader_setVector2Parameter(arg1,(char const *)arg2,arg3);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:516:42: note: declared here
  516 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setVector2Parameter(sfShader* shader, const char* name, sfVector2f vector);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setVector3Parameter_graphics_23698568018502eb’:
Graphics_wrap.c:6526:3: warning: ‘sfShader_setVector3Parameter’ is deprecated [-Wdeprecated-declarations]
 6526 |   sfShader_setVector3Parameter(arg1,(char const *)arg2,arg3);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:539:42: note: declared here
  539 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setVector3Parameter(sfShader* shader, const char* name, sfVector3f vector);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setColorParameter_graphics_23698568018502eb’:
Graphics_wrap.c:6552:3: warning: ‘sfShader_setColorParameter’ is deprecated [-Wdeprecated-declarations]
 6552 |   sfShader_setColorParameter(arg1,(char const *)arg2,arg3);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:567:42: note: declared here
  567 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setTransformParameter_graphics_23698568018502eb’:
Graphics_wrap.c:6578:3: warning: ‘sfShader_setTransformParameter’ is deprecated [-Wdeprecated-declarations]
 6578 |   sfShader_setTransformParameter(arg1,(char const *)arg2,arg3);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:590:42: note: declared here
  590 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setTextureParameter_graphics_23698568018502eb’:
Graphics_wrap.c:6597:3: warning: ‘sfShader_setTextureParameter’ is deprecated [-Wdeprecated-declarations]
 6597 |   sfShader_setTextureParameter(arg1,(char const *)arg2,(struct sfTexture const *)arg3);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:623:42: note: declared here
  623 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setCurrentTextureParameter_graphics_23698568018502eb’:
Graphics_wrap.c:6614:3: warning: ‘sfShader_setCurrentTextureParameter’ is deprecated [-Wdeprecated-declarations]
 6614 |   sfShader_setCurrentTextureParameter(arg1,(char const *)arg2);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:646:42: note: declared here
  646 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

What am I doing wrong?

Telroshan commented 2 years ago

Hello, you were actually doing nothing wrong. This was due to some deprecated functions being included in the generated bindings. Most of them are fixed with the latest release, though one remains : a deprecation warning about sfMouseWheelEvent, that I still have to figure out how to fix (adding ignore rules in the interfaces files didn't actually ignore them, I'll have to look more into it). Leaving this issue open until I fix the latter.