Bug 1225795 - Package libcaca does not build with gcc14 because of new errors
Summary: Package libcaca does not build with gcc14 because of new errors
Status: IN_PROGRESS
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Martin Jambor
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: modern_C
  Show dependency treegraph
 
Reported: 2024-06-02 09:56 UTC by Martin Jambor
Modified: 2024-06-18 14:05 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Fix to ruby bindings (1.33 KB, patch)
2024-06-17 16:56 UTC, Martin Jambor
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jambor 2024-06-02 09:56:22 UTC
GCC 14 newly by default treats as errors a number of situations which
before were only warnings.  For more information see
https://gcc.gnu.org/gcc-14/porting_to.html and meta bug #1220571.

Because of this, package libcaca fails to compile.  This can be seen online
at:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/libcaca/standard/x86_64

It can be reproduced locally with command: osc build --clean
--alternative-project home:rguenther:nextgcc

We seem to need a patch from https://src.fedoraproject.org/rpms/libcaca/c/27b246122bf1aa47ab437d09d9a1bdbef64a4b25?branch=rawhide


The (first) error (that halts the build) is:

[   25s] caca-font.c: In function 'Init_caca_font':
[   25s] /usr/include/ruby-3.3.0/ruby/internal/anyargs.h:308:143: error: passing argument 3 of 'rb_define_singleton_method_00' from incompatible pointer type [-Wincompatible-pointer-types]
[   25s]   308 | #define rb_define_singleton_method(obj, mid, func, arity)   RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method((arity), (func))((obj), (mid), (func), (arity))
[   25s]       |                                                                                                                                               ^~~~~~
[   25s]       |                                                                                                                                               |
[   25s]       |                                                                                                                                               VALUE (*)(void) {aka long unsigned int (*)(void)}
[   25s] caca-font.c:97:5: note: in expansion of macro 'rb_define_singleton_method'
[   25s]    97 |     rb_define_singleton_method(cFont, "list", font_list, 0);
[   25s]       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
[   25s] /usr/include/ruby-3.3.0/ruby/internal/anyargs.h:271:21: note: expected 'VALUE (*)(VALUE)' {aka 'long unsigned int (*)(long unsigned int)'} but argument is of type 'VALUE (*)(void)' {aka 'long unsigned int (*)(void)'}
[   25s]   271 | RBIMPL_ANYARGS_DECL(rb_define_singleton_method, VALUE, const char *)
[   25s]       |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
[   25s] /usr/include/ruby-3.3.0/ruby/internal/anyargs.h:255:41: note: in definition of macro 'RBIMPL_ANYARGS_DECL'
[   25s]   255 | RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _00(__VA_ARGS__, VALUE(*)(VALUE), int); \
[   25s]       |                                         ^~~
Comment 1 Martin Jambor 2024-06-14 16:11:49 UTC
Having a better look, the patch from redhat does not help with the issue we are seeing where a passed call-back function seems to have one fewer arguments than what the function receiving the call-back expects. Scary.

For now I'm moving on, but I'm inclined to simply side-step this issue with -fpermissive.
Comment 2 Martin Jambor 2024-06-17 16:56:44 UTC
Created attachment 875530 [details]
Fix to ruby bindings

OK, I was lying, I did not move on, the attached patch adds the missing parameters.
Comment 3 Martin Jambor 2024-06-17 17:15:19 UTC
Submitted https://build.opensuse.org/request/show/1181354
Comment 4 OBSbugzilla Bot 2024-06-18 14:05:03 UTC
This is an autogenerated message for OBS integration:
This bug (1225795) was mentioned in
https://build.opensuse.org/request/show/1181507 Factory / libcaca