Bug 1225928

Summary: Package sgmltool does not build with gcc14 because of new errors
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Jambor <mjambor>
Component: OtherAssignee: Martin Jambor <mjambor>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: ke
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-04 12:15:56 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 sgmltool fails to compile.  This can be seen online
at:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/sgmltool/standard/x86_64

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


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

[   99s] std.h:95:14: error: conflicting types for ‘fpos_t’; have ‘long int’
[   99s]    95 | typedef long fpos_t;
[   99s]       |              ^~~~~~
[   99s] In file included from sgmlsasp.h:4,
[   99s]                  from replace.c:6:
Comment 1 Martin Jambor 2024-07-15 11:18:05 UTC
The failures causing the build to fail all come from total
misconfiguration in the sgmls-1.1 subdirectory where pretty much all
snippets to test features violate C99 by not specifying a return type
form main - and many also use undeclared exit and _exit and who knows
what.  The most conservative fix is to add -fpermissive to the
invocation of ./configure in sgmls-1.1/Makefile.

However, the handling of compilation flags seems rather bothed all
over the place, CFLAGS (and therefore also RPM %{optflags}) are
quickly lost which means we compile evertyhing with just -O (that is
-O1) and without any of the fortification options that distro packages
should use.  I am attempting to address this - but will keep in place
overriding the optimization level to -O1 to minimize chances of some
fallout.
Comment 2 Martin Jambor 2024-07-15 11:23:23 UTC
I have created https://build.opensuse.org/request/show/1187544