gjtorikian / mathematical

Convert mathematical equations to SVGs, PNGs, or MathML. A general wrapper to Lasem and mtex2MML.
https://gjtorikian.github.io/mathematical/
MIT License
166 stars 31 forks source link

Compilation fails for Ruby-3.3.0 on Fedora 40 with gcc 14 #134

Closed illukin closed 1 week ago

illukin commented 2 months ago
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -I/usr/include/libxml2 -I/home/user/.gem/ruby/3.3.0/gems/mathematical-1.6.18/ext/mathematical/mtex2MML/src -I/home/user/.gem/ruby/3.3.0/gems/mathematical-1.6.18/ext/mathematical/lasem/src    -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -O2 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/webp -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/libxml2 -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/sysprof-6 -pthread -I/usr/include/pixman-1 -m64 -o mathematical.o -c mathematical.c
In file included from ./mathematical.h:15,
                 from mathematical.c:23:
/usr/include/glib-2.0/glib/gi18n.h:28:10: warning: "_" redefined
   28 | #define  _(String) gettext (String)
      |          ^
In file included from /usr/include/ruby/defines.h:77,
                 from /usr/include/ruby/ruby.h:25,
                 from /usr/include/ruby.h:38,
                 from ./mathematical.h:4:
/usr/include/ruby/backward/2/stdarg.h:33:10: note: this is the location of the previous definition
   33 | # define _(args) args
      |          ^
mathematical.c: In function 'process':
mathematical.c:138:77: error: passing argument 2 of 'cairo_svg_surface_create_for_stream' makes pointer from integer without a cast [-Wint-conversion]
  138 |     surface = cairo_svg_surface_create_for_stream (cairoSvgSurfaceCallback, self, width_pt, height_pt);
      |                                                                             ^~~~
      |                                                                             |
      |                                                                             VALUE {aka long unsigned int}
In file included from ./mathematical.h:18:
/usr/include/cairo/cairo-svg.h:102:57: note: expected 'void *' but argument is of type 'VALUE' {aka 'long unsigned int'}
  102 |                                      void              *closure,
      |                                      ~~~~~~~~~~~~~~~~~~~^~~~~~~
mathematical.c:149:91: error: passing argument 3 of 'cairo_surface_write_to_png_stream' makes pointer from integer without a cast [-Wint-conversion]
  149 |     cairo_surface_write_to_png_stream (cairo_get_target (cairo), cairoPngSurfaceCallback, self);
      |                                                                                           ^~~~
      |                                                                                           |
      |                                                                                           VALUE {aka long unsigned int}
In file included from /home/user/.gem/ruby/3.3.0/gems/mathematical-1.6.18/ext/mathematical/lasem/src/lsmcairo.h:28,
                 from /home/user/.gem/ruby/3.3.0/gems/mathematical-1.6.18/ext/mathematical/lasem/src/lsm.h:29,
                 from ./mathematical.h:11:
/usr/include/cairo/cairo.h:2606:58: note: expected 'void *' but argument is of type 'VALUE' {aka 'long unsigned int'}
 2606 |                                    void                 *closure);
      |                                    ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
mathematical.c: In function 'MATHEMATICAL_process':
mathematical.c:234:40: error: passing argument 2 of 'rb_rescue' makes integer from pointer without a cast [-Wint-conversion]
  234 |     output = rb_rescue(process_helper, args, process_rescue, rb_Input);
      |                                        ^~~~
      |                                        |
      |                                        VALUE * {aka long unsigned int *}
In file included from /usr/include/ruby/ruby.h:41:
/usr/include/ruby/internal/iterator.h:364:47: note: expected 'VALUE' {aka 'long unsigned int'} but argument is of type 'VALUE *' {aka 'long unsigned int *'}
  364 | VALUE rb_rescue(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*r_proc)(VALUE, VALUE), VALUE data2);
      |                                         ~~~~~~^~~~~
mathematical.c:258:40: error: passing argument 2 of 'rb_rescue' makes integer from pointer without a cast [-Wint-conversion]
  258 |       hash = rb_rescue(process_helper, args, process_rescue, math);
      |                                        ^~~~
      |                                        |
      |                                        VALUE * {aka long unsigned int *}
/usr/include/ruby/internal/iterator.h:364:47: note: expected 'VALUE' {aka 'long unsigned int'} but argument is of type 'VALUE *' {aka 'long unsigned int *'}
  364 | VALUE rb_rescue(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*r_proc)(VALUE, VALUE), VALUE data2);
      |                                         ~~~~~~^~~~~
mathematical.c:267:12: error: assignment to 'VALUE' {aka 'long unsigned int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion]
  267 |     output = NULL;
      |            ^
make: *** [Makefile:249: mathematical.o] Error 1
4e554c4c commented 1 week ago

should be resolved in #136