Graph.cc: error: format not a string literal and no format arguments

Librairie C++ de calcul formel/ C++ symbolic computation library

Modérateur : xcasadmin

sagitter
Messages : 31
Inscription : sam. mai 14, 2016 6:19 pm
Localisation : Italy

Graph.cc: error: format not a string literal and no format arguments

Message par sagitter » ven. nov. 18, 2022 8:39 pm

Hi all.

Graph.cc (giac-1.9.0 29) is not compiled:

Code : Tout sélectionner

/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -DIN_GIAC -I. -I.. -I. -I..       -std=gnu++14 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-strict-aliasing -DGIAC_GENERIC_CONSTANTS -DTIMEOUT -DHAVE_LIBMICROPYTHON -fpermissive -DQUICKJS -c -o Graph.lo Graph.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -DIN_GIAC -I. -I.. -I. -I.. -std=gnu++14 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-strict-aliasing -DGIAC_GENERIC_CONSTANTS -DTIMEOUT -DHAVE_LIBMICROPYTHON -fpermissive -DQUICKJS -c Graph.cc  -fPIC -DPIC -o .libs/Graph.o
In file included from giacPCH.h:8,
                 from Graph.h:7,
                 from Graph.cc:2:
index.h:33: warning: ignoring '#pragma anon_unions ' [-Wunknown-pragmas]
   33 | #pragma anon_unions
      | 
In file included from poly.h:26,
                 from gen.h:71,
                 from giacPCH.h:32:
monomial.h:341:10: warning: 'template<class _Arg1, class _Arg2, class _Result> class std::pointer_to_binary_function' is deprecated [-Wdeprecated-declarations]
  341 |     std::pointer_to_binary_function < const monomial<T> &, const monomial<T> &, bool> strictly_greater ;
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12/bits/refwrap.h:39,
                 from /usr/include/c++/12/vector:66,
                 from vector.h:474,
                 from index.h:21:
/usr/include/c++/12/bits/stl_function.h:1131:11: note: declared here
 1131 |     class pointer_to_binary_function
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
monomial.h:342:28: warning: 'template<class _Arg1, class _Arg2, class _Result> class std::pointer_to_binary_function' is deprecated [-Wdeprecated-declarations]
  342 |     sort_helper(const std::pointer_to_binary_function < const monomial<T> &, const monomial<T> &, bool> is_strictly_greater):strictly_greater(is_strictly_greater) {};
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_function.h:1131:11: note: declared here
 1131 |     class pointer_to_binary_function
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
monomial.h:680:25: warning: 'template<class _Arg1, class _Arg2, class _Result> class std::pointer_to_binary_function' is deprecated [-Wdeprecated-declarations]
  680 |              const std::pointer_to_binary_function < const monomial<T> &, const monomial<T> &, bool> m_is_strictly_greater
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_function.h:1131:11: note: declared here
 1131 |     class pointer_to_binary_function
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
monomial.h: In function 'void giac::Mul(typename std::vector<monomial<T> >::const_iterator&, typename std::vector<monomial<T> >::const_iterator&, typename std::vector<monomial<T> >::const_iterator&, typename std::vector<monomial<T> >::const_iterator&, std::vector<monomial<T> >&, bool (*)(const index_m&, const index_m&), std::pointer_to_binary_function<const monomial<T>&, const monomial<T>&, bool>)':
monomial.h:729:44: warning: 'template<class _Arg1, class _Arg2, class _Result> class std::pointer_to_binary_function' is deprecated [-Wdeprecated-declarations]
  729 |     typedef std::map< index_t,T,const std::pointer_to_binary_function < const index_m &, const index_m &, bool> > application;
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_function.h:1131:11: note: declared here
 1131 |     class pointer_to_binary_function
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
monomial.h:730:37: warning: 'std::pointer_to_binary_function<_Arg1, _Arg2, _Result> std::ptr_fun(_Result (*)(_Arg1, _Arg2)) [with _Arg1 = const giac::index_m&; _Arg2 = const giac::index_m&; _Result = bool]' is deprecated: use 'std::function' instead [-Wdeprecated-declarations]
  730 |     application produit(std::ptr_fun(is_strictly_greater));
      |                         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_function.h:1153:5: note: declared here
 1153 |     ptr_fun(_Result (*__x)(_Arg1, _Arg2))
      |     ^~~~~~~
poly.h: At global scope:
poly.h:43:10: warning: 'template<class _Arg1, class _Arg2, class _Result> class std::pointer_to_binary_function' is deprecated [-Wdeprecated-declarations]
   43 |     std::pointer_to_binary_function < const monomial<T> &, const monomial<T> &, bool> m_is_strictly_greater ;
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_function.h:1131:11: note: declared here
 1131 |     class pointer_to_binary_function
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
gen.h: In constructor 'giac::eqwdata::eqwdata(int, int, int, int, const giac::attributs&, const giac::gen&)':
gen.h:1408:15: warning: 'giac::eqwdata::eqw_attributs' will be initialized after [-Wreorder]
 1408 |     attributs eqw_attributs;
      |               ^~~~~~~~~~~~~
gen.h:1401:9: warning:   'int giac::eqwdata::x' [-Wreorder]
 1401 |     int x,y,dx,dy;
      |         ^
gen.h:1409:5: warning:   when initialized here [-Wreorder]
 1409 |     eqwdata(int dxx,int dyy,int xx, int yy,const attributs & a,const gen& gg):g(gg),eqw_attributs(a),x(xx),y(yy),dx(dxx),dy(dyy),selected(false),active(false),hasbaseline(false),modifiable(true),baseline(0) {};
      |     ^~~~~~~
gen.h:1407:10: warning: 'giac::eqwdata::modifiable' will be initialized after [-Wreorder]
 1407 |     bool modifiable;
      |          ^~~~~~~~~~
gen.h:1402:9: warning:   'int giac::eqwdata::baseline' [-Wreorder]
 1402 |     int baseline;
      |         ^~~~~~~~
gen.h:1409:5: warning:   when initialized here [-Wreorder]
 1409 |     eqwdata(int dxx,int dyy,int xx, int yy,const attributs & a,const gen& gg):g(gg),eqw_attributs(a),x(xx),y(yy),dx(dxx),dy(dyy),selected(false),active(false),hasbaseline(false),modifiable(true),baseline(0) {};
      |     ^~~~~~~
gen.h: In constructor 'giac::eqwdata::eqwdata(int, int, int, int, const giac::attributs&, const giac::gen&, int)':
gen.h:1408:15: warning: 'giac::eqwdata::eqw_attributs' will be initialized after [-Wreorder]
 1408 |     attributs eqw_attributs;
      |               ^~~~~~~~~~~~~
gen.h:1401:9: warning:   'int giac::eqwdata::x' [-Wreorder]
 1401 |     int x,y,dx,dy;
      |         ^
gen.h:1410:5: warning:   when initialized here [-Wreorder]
 1410 |     eqwdata(int dxx,int dyy,int xx, int yy,const attributs & a,const gen& gg,int mybaseline):g(gg),eqw_attributs(a),x(xx),y(yy),dx(dxx),dy(dyy),selected(false),active(false),hasbaseline(true),modifiable(true),baseline(mybaseline) {};
      |     ^~~~~~~
gen.h:1407:10: warning: 'giac::eqwdata::modifiable' will be initialized after [-Wreorder]
 1407 |     bool modifiable;
      |          ^~~~~~~~~~
gen.h:1402:9: warning:   'int giac::eqwdata::baseline' [-Wreorder]
 1402 |     int baseline;
      |         ^~~~~~~~
gen.h:1410:5: warning:   when initialized here [-Wreorder]
 1410 |     eqwdata(int dxx,int dyy,int xx, int yy,const attributs & a,const gen& gg,int mybaseline):g(gg),eqw_attributs(a),x(xx),y(yy),dx(dxx),dy(dyy),selected(false),active(false),hasbaseline(true),modifiable(true),baseline(mybaseline) {};
      |     ^~~~~~~
In file included from sym2poly.h:27,
                 from giacPCH.h:38:
gausspol.h: At global scope:
gausspol.h:96:29: warning: 'template<class _Arg1, class _Arg2, class _Result> class std::pointer_to_binary_function' is deprecated [-Wdeprecated-declarations]
   96 |                  const std::pointer_to_binary_function < const monomial<gen> &, const monomial<gen> &, bool> m_is_greater
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_function.h:1131:11: note: declared here
 1131 |     class pointer_to_binary_function
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
Graph.cc: In function 'giac::rgba_image xcas::fltk2image(Fl_Image*, const giac::context*)':
Graph.cc:267:15: warning: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Wsign-compare]
  267 |     for (i=0;i<h;++i)
      |              ~^~
Graph.cc:268:17: warning: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Wsign-compare]
  268 |       for (j=0;j<w;++j)
      |                ~^~
Graph.cc:269:19: warning: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Wsign-compare]
  269 |         for (k=0;k<d;++k,++l)
      |                  ~^~
Graph.h: In constructor 'xcas::Graph2d3d::Graph2d3d(int, int, int, int, const char*, double, double, double, double, double, double, double, xcas::History_Pack*)':
Graph.h:136:10: warning: 'xcas::Graph2d3d::show_mouse_on_object' will be initialized after [-Wreorder]
  136 |     bool show_mouse_on_object; // FL_MOVE always handled or not
      |          ^~~~~~~~~~make[2]: Leaving directory '/builddir/build/BUILD/giac-1.9.0/src'
~~~~~~~~~~
Graph.h:126:9: warning:   'int xcas::Graph2d3d::mode' [-Wreorder]
  126 |     int mode; // 0 pointer, 1 1-arg, 2 2-args, etc.
      |         ^~~~
Graph.cc:1468:3: warning:   when initialized here [-Wreorder]
 1468 |   Graph2d3d::Graph2d3d(int x,int y,int w,int h,const char * l,double xmin,double xmax,double ymin,double ymax,double zmin,double zmax,double ortho,History_Pack * hp_):
      |   ^~~~~~~~~
Graph.h:165:45: warning: 'xcas::Graph2d3d::rotanim_tstep' will be initialized after [-Wreorder]
  165 |     double rotanim_rx,rotanim_ry,rotanim_rz,rotanim_tstep;
      |                                             ^~~~~~~~~~~~~
Graph.h:165:12: warning:   'double xcas::Graph2d3d::rotanim_rx' [-Wreorder]
  165 |     double rotanim_rx,rotanim_ry,rotanim_rz,rotanim_tstep;
      |            ^~~~~~~~~~
Graph.cc:1468:3: warning:   when initialized here [-Wreorder]
 1468 |   Graph2d3d::Graph2d3d(int x,int y,int w,int h,const char * l,double xmin,double xmax,double ymin,double ymax,double zmin,double zmax,double ortho,History_Pack * hp_):
      |   ^~~~~~~~~
Graph.h: In constructor 'xcas::Graph2d3d::Graph2d3d(int, int, int, int, const char*, xcas::History_Pack*)':
Graph.h:137:14: warning: 'xcas::Graph2d3d::display_mode' will be initialized after [-Wreorder]
  137 |     unsigned display_mode ;
      |              ^~~~~~~~~~~~
Graph.h:126:9: warning:   'int xcas::Graph2d3d::mode' [-Wreorder]
  126 |     int mode; // 0 pointer, 1 1-arg, 2 2-args, etc.
      |         ^~~~
Graph.cc:1501:3: warning:   when initialized here [-Wreorder]
 1501 |   Graph2d3d::Graph2d3d(int x,int y,int w,int h,const char * l,History_Pack * hp_):
      |   ^~~~~~~~~
Graph.h:165:45: warning: 'xcas::Graph2d3d::rotanim_tstep' will be initialized after [-Wreorder]
  165 |     double rotanim_rx,rotanim_ry,rotanim_rz,rotanim_tstep;
      |                                             ^~~~~~~~~~~~~
Graph.h:165:12: warning:   'double xcas::Graph2d3d::rotanim_rx' [-Wreorder]
  165 |     double rotanim_rx,rotanim_ry,rotanim_rz,rotanim_tstep;
      |            ^~~~~~~~~~
Graph.cc:1501:3: warning:   when initialized here [-Wreorder]
 1501 |   Graph2d3d::Graph2d3d(int x,int y,int w,int h,const char * l,History_Pack * hp_):
      |   ^~~~~~~~~
Graph.cc: In member function 'virtual void xcas::Graph2d3d::autoscale(bool)':
Graph.cc:2549:11: warning: unused variable 's' [-Wunused-variable]
 2549 |       int s;
      |           ^
Graph.cc: In function 'const char* xcas::latexfilename(const char*)':
Graph.cc:2701:19: warning: 'int fl_ask(const char*, ...)' is deprecated [-Wdeprecated-declarations]
 2701 |       int i=fl_ask("%s",("File "+s+" exists. Overwrite?").c_str());
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/FL/fl_message.H:19,
                 from Editeur.h:35,
                 from Graph.h:33:
/usr/include/FL/fl_ask.H:55:15: note: declared here
   55 | FL_EXPORT int fl_ask(const char *,...) __fl_attr((__format__ (__printf__, 1, 2), __deprecated__));
      |               ^~~~~~
Graph.cc: In function 'int xcas::chooseinvecteur(const giac::vecteur&)':
Graph.cc:2910:24: warning: too many arguments for format [-Wformat-extra-args]
 2910 |       return fl_choice("Choose",v[0].print(giac::context0).c_str(),v[1].print(giac::context0).c_str(),v[2].print(giac::context0).c_str(),v[3].print(giac::context0).c_str());
      |                        ^~~~~~~~
Graph.cc:2911:22: warning: too many arguments for format [-Wformat-extra-args]
 2911 |     return fl_choice("Choose",v[0].print(giac::context0).c_str(),v[1].print(giac::context0).c_str(),v[2].print(giac::context0).c_str(),v[3].print(giac::context0).c_str(),v[4].print(giac::context0).c_str());
      |                      ^~~~~~~~
Graph.cc: In member function 'virtual int xcas::Graph2d::in_handle(int)':
Graph.cc:3217:26: warning: unused variable 'newz' [-Wunused-variable]
 3217 |         double newx,newy,newz;
      |                          ^~~~
Graph.cc: In function 'int xcas::change_line_type(int&, bool, bool&, const std::string&, bool, bool&, bool&, bool, int)':
Graph.cc:3281:30: warning: unused variable 'button_approx' [-Wunused-variable]
 3281 |     static Fl_Check_Button * button_approx=0, * button_formel=0,*button_untranslate=0;
      |                              ^~~~~~~~~~~~~
Graph.cc: In member function 'void xcas::Graph2d3d::change_attributs()':
Graph.cc:3654:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'unsigned int'} [-Wsign-compare]
 3654 |       if (i>=0 && i<selected.size())
      |                   ~^~~~~~~~~~~~~~~~
Graph.cc: In member function 'int xcas::Graph2d3d::geo_handle(int)':
Graph.cc:3717:53: warning: comparison of integer expressions of different signedness: 'std::size_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
 3717 |     if (mode>=2 && event==FL_MOVE && args_tmp.size()>mode)
      |                                      ~~~~~~~~~~~~~~~^~~~~
Graph.cc:3726:81: warning: comparison of integer expressions of different signedness: 'std::size_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
 3726 |       tmp=geometry_round(newx,newy,newz,eps,tmp2,pos,mode==0 || (args_tmp.size()==mode && function_final.type==_FUNC && equalposcomp(transformation_functions,*function_final._FUNCptr)),event==FL_RELEASE);
      |                                                                  ~~~~~~~~~~~~~~~^~~~~~
Graph.cc:3974:32: warning: comparison of integer expressions of different signedness: 'std::size_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
 3974 |     if (npoints+args_tmp.size()>mode)
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
Graph.cc:4011:11: warning: unused variable 'save_undo_position' [-Wunused-variable]
 4011 |       int save_undo_position=hp->undo_position;
      |           ^~~~~~~~~~~~~~~~~~
Graph.cc: In function 'void xcas::cb_set_mode(Fl_Widget*, const giac::gen&, const giac::gen&, int, const std::string&)':
Graph.cc:4525:21: warning: 'int fl_ask(const char*, ...)' is deprecated [-Wdeprecated-declarations]
 4525 |         int i=fl_ask("%s","Dynamic geometry works faster in approx mode. Drag in approx mode?");
      |               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/FL/fl_ask.H:55:15: note: declared here
   55 | FL_EXPORT int fl_ask(const char *,...) __fl_attr((__format__ (__printf__, 1, 2), __deprecated__));
      |               ^~~~~~
Graph.cc: In function 'void xcas::fl_pie_seg(int, int, int, int, int, int, bool)':
Graph.cc:4956:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'unsigned int'} [-Wsign-compare]
 4956 |     for (;i<v.size()-1;++i){
      |           ~^~~~~~~~~~~
Graph.cc: In function 'bool xcas::inputdouble(const char*, double&, const giac::context*)':
Graph.cc:5643:29: error: format not a string literal and no format arguments [-Werror=format-security]
 5643 |     const char * ch=fl_input(msg,print_DOUBLE_(d).c_str());
      |                     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graph.cc: In member function 'void xcas::Graph2d3d::tracemode_set(int)':
Graph.cc:5670:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'unsigned int'} [-Wsign-compare]
 5670 |     for (int i=0;i<plot_instructions.size();++i){
      |                  ~^~~~~~~~~~~~~~~~~~~~~~~~~
Graph.cc:5674:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'unsigned int'} [-Wsign-compare]
 5674 |         for (int j=0;j<v.size();++j)
      |                      ~^~~~~~~~~
Graph.cc:5684:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'unsigned int'} [-Wsign-compare]
 5684 |     for (;tracemode_n<tracemode_v.size();++tracemode_n){
      |           ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
Graph.cc:5689:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'unsigned int'} [-Wsign-compare]
 5689 |     if (tracemode_n>=tracemode_v.size()){
      |         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
Graph.cc:5692:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'unsigned int'} [-Wsign-compare]
 5692 |         for (tracemode_n=0;tracemode_n<tracemode_v.size();++tracemode_n){
      |                            ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
Graph.cc:5698:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'unsigned int'} [-Wsign-compare]
 5698 |       if (tracemode_n>=tracemode_v.size()){
      |           ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
Graph.cc:5782:19: error: format not a string literal and no format arguments [-Werror=format-security]
 5782 |           fl_alert((gettext("Root at ")+sol.print(contextptr)).c_str());
      |           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graph.cc:5789:19: error: format not a string literal and no format arguments [-Werror=format-security]
 5789 |           fl_alert((gettext("y'=0, extremum/singular pt at ")+sol.print(contextptr)).c_str());
      |           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graph.cc:5799:21: error: format not a string literal and no format arguments [-Werror=format-security]
 5799 |             fl_alert((gettext("x'=0, vertical or singular: ")+sol.print(contextptr)).c_str());
      |             ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graph.cc:5807:19: error: format not a string literal and no format arguments [-Werror=format-security]
 5807 |           fl_alert(("x'*y''-x''*y'=0: "+sol.print(contextptr)).c_str());
      |           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graph.cc:5829:19: error: format not a string literal and no format arguments [-Werror=format-security]
 5829 |           fl_alert((gettext("Numerical Integration Error: ")+ss).c_str());
      |           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graph.cc:5831:19: error: format not a string literal and no format arguments [-Werror=format-security]
 5831 |           fl_alert((ss+": "+res.print(contextptr)).c_str());
      |           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graph.cc:5876:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'unsigned int'} [-Wsign-compare]
 5876 |       for (int j=0;j<tracemode_v.size();++j){
      |                    ~^~~~~~~~~~~~~~~~~~~
Graph.cc:5889:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'unsigned int'} [-Wsign-compare]
 5889 |         for (int i=0;i<V.size();++i){
      |                      ~^~~~~~~~~
Graph.cc:5941:15: error: format not a string literal and no format arguments [-Werror=format-security]
 5941 |       fl_alert((curve_infos1+'\n'+curve_infos2).c_str());
      |       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graph.cc: In member function 'void xcas::Graph2d::in_draw(int, int, int, int, int&)':
Graph.cc:6076:82: warning: unused variable 'it' [-Wunused-variable]
 6076 |       const_iterateur at=plot_instructions.begin(),atend=plot_instructions.end(),it,itend;
      |                                                                                  ^~
Graph.cc:6076:85: warning: unused variable 'itend' [-Wunused-variable]
 6076 |       const_iterateur at=plot_instructions.begin(),atend=plot_instructions.end(),it,itend;
      |                                                                                     ^~~~~
Graph.cc: In member function 'void xcas::Graph2d3d::update(Fl_Group*, int)':
Graph.cc:6494:47: warning: enum constant in boolean context [-Wint-in-bool-context]
 6494 |       if ( (last_event=FL_DRAG || last_event==FL_RELEASE) && pack->children()>pos){
      |                                               ^~~~~~~~~~
Graph.cc: In member function 'void xcas::Figure::save_figure_as(const std::string&)':
Graph.cc:6597:21: warning: 'int fl_ask(const char*, ...)' is deprecated [-Wdeprecated-declarations]
 6597 |         int i=fl_ask("%s",(s+gettext(": file exists. Overwrite?")).c_str());
      |               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/FL/fl_ask.H:55:15: note: declared here
   55 | FL_EXPORT int fl_ask(const char *,...) __fl_attr((__format__ (__printf__, 1, 2), __deprecated__));
      |               ^~~~~~
Graph.cc: In member function 'void xcas::Gen_Value_Slider::adjust(bool)':
Graph.cc:8982:40: warning: comparison of integer expressions of different signedness: 'std::size_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
 8982 |             if (position>=0 && v.size()>position){
      |                                ~~~~~~~~^~~~~~~~~
Graph.cc: At global scope:
Graph.cc:7427:15: warning: 'void xcas::cb_Approx(Fl_Button*, void*)' defined but not used [-Wunused-function]
 7427 |   static void cb_Approx(Fl_Button * b , void*) {
      |               ^~~~~~~~~
Graph.cc:7420:15: warning: 'void xcas::cb_Exact(Fl_Button*, void*)' defined but not used [-Wunused-function]
 7420 |   static void cb_Exact(Fl_Button * b , void*) {
      |               ^~~~~~~~
Graph.cc:3281:30: warning: 'button_approx' defined but not used [-Wunused-variable]
 3281 |     static Fl_Check_Button * button_approx=0, * button_formel=0,*button_untranslate=0;
      |                              ^~~~~~~~~~~~~
cc1plus: some warnings being treated as errors
make[2]: *** [Makefile:993: Graph.lo] Error 1
I'm using GCC-12.2.1 on Fedora 38
mailto: sagitter 'at' fedoraproject 'dot' org
https://fedoraproject.org/wiki/User:Sagitter

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Graph.cc: error: format not a string literal and no format arguments

Message par parisse » jeu. nov. 24, 2022 8:29 am

Probably related to -Werror=format-security
I will see how I can change fl_alert calls, perhaps adding "%s", as first argument will solve the issue.

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Graph.cc: error: format not a string literal and no format arguments

Message par parisse » jeu. nov. 24, 2022 9:15 am

I have added "%s" in all fl_alert in Graph.cc and Graph3d.cc. Will be in giac-1.0.9-31.

sagitter
Messages : 31
Inscription : sam. mai 14, 2016 6:19 pm
Localisation : Italy

Re: Graph.cc: error: format not a string literal and no format arguments

Message par sagitter » dim. déc. 04, 2022 3:25 pm

parisse a écrit :
jeu. nov. 24, 2022 9:15 am
I have added "%s" in all fl_alert in Graph.cc and Graph3d.cc. Will be in giac-1.0.9-31.
Thank you
mailto: sagitter 'at' fedoraproject 'dot' org
https://fedoraproject.org/wiki/User:Sagitter

Répondre