Bug 1225792

Summary: Package kbuild does not build with gcc14 because of all sorts of C99 violations
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Jambor <mjambor>
Component: DevelopmentAssignee: Martin Jambor <mjambor>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 1220571    

Description Martin Jambor 2024-06-02 08:43:32 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 kbuild fails to compile.  This can be seen online
at:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/kbuild/standard/x86_64

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

We probably need what Fedore did and what is listed at:
https://gitlab.com/fweimer-rh/fedora-modernc/-/blob/main/pkg/k/kBuild.md?ref_type=heads


The error (that halts the build) is:

[   24s] /home/abuild/rpmbuild/BUILD/kbuild-0.1.9998svn3427/src/kmk/loadapi.c: In function ‘gmk_eval’:
[   24s] /home/abuild/rpmbuild/BUILD/kbuild-0.1.9998svn3427/src/kmk/loadapi.c:62:51: error: passing argument 3 of ‘eval_buffer’ makes pointer from integer without a cast [-Wint-conversion]
[   24s]    62 |   eval_buffer (s, flp IF_WITH_VALUE_LENGTH_PARAM (strlen (s) /** @todo suboptimal */));
[   24s]       |                                                   ^~~~~~~~~~
[   24s]       |                                                   |
[   24s]       |                                                   size_t {aka long unsigned int}
[   24s] /home/abuild/rpmbuild/BUILD/kbuild-0.1.9998svn3427/src/kmk/makeint.h:265:51: note: in definition of macro ‘IF_WITH_VALUE_LENGTH_PARAM’
[   24s]   265 | # define IF_WITH_VALUE_LENGTH_PARAM(a_Expr)     , a_Expr
[   24s]       |                                                   ^~~~~~
[   24s] /home/abuild/rpmbuild/BUILD/kbuild-0.1.9998svn3427/src/kmk/dep.h:175:83: note: expected ‘char *’ but argument is of type ‘size_t’ {aka ‘long unsigned int’}
[   24s]   175 | void eval_buffer (char *buffer, const floc *floc IF_WITH_VALUE_LENGTH(COMMA char *eos));
[   24s]       |                                                                             ~~~~~~^~~
[   24s] /home/abuild/rpmbuild/BUILD/kbuild-0.1.9998svn3427/src/kmk/makeint.h:264:49: note: in definition of macro ‘IF_WITH_VALUE_LENGTH’
[   24s]   264 | # define IF_WITH_VALUE_LENGTH(a_Expr)           a_Expr
[   24s]       |                                                 ^~~~~~
Comment 1 Martin Jambor 2024-06-06 07:30:50 UTC
I'm having a look.
Comment 2 Martin Jambor 2024-06-07 11:35:19 UTC
I have submitted https://build.opensuse.org/request/show/1179185