Opened 7 weeks ago

Closed 7 weeks ago

Last modified 7 weeks ago

#5729 closed defect (fixed)

topology failing on building on GHA that treat warnins as errors and Cirrus FreeBSD

Reported by: robe Owned by: strk
Priority: blocker Milestone: PostGIS 3.5.0
Component: topology Version: master
Keywords: Cc:

Description

Now that I have GHA properly showing failures, it's showing a bit of a train wreck on topology.

The ubuntu tests that treat warnings as errors:

https://github.com/postgis/postgis/actions/runs/9066395839/job/24909205720

local/include -c lwcurvepoly.c -o lwcurvepoly.o >/dev/null 2>&1
topo/lwgeom_topo.c:5136:19: error: comparison of integer expressions of different signedness: 'int' and 'uint64_t' {aka 'long unsigned int'} [-Werror=sign-compare]
 5136 |   for ( int t=0; t<firstNodeEdges->numEdges; t++ )
      |                   ^
topo/lwgeom_topo.c:5240:23: error: comparison of integer expressions of different signedness: 'int' and 'uint64_t' {aka 'long unsigned int'} [-Werror=sign-compare]
 5240 |       for ( int t=0; t<splitNodeEdges->numEdges; t++ )
      |                       ^
topo/lwgeom_topo.c:5459:23: error: comparison of integer expressions of different signedness: 'int' and 'uint64_t' {aka 'long unsigned int'} [-Werror=sign-compare]
 5459 |       for ( int t=0; t<commonNodeEdges->numEdges; t++ )
      |                       ^
libtool: compile:  gcc -I./../deps/ryu/.. -I/usr/local/include -I/usr/include/libxml2 -I/usr/local/include -I/usr/include/json-c -DNDEBUG -I. -I. -std=gnu99 -g -O2 -mtune=generic -fno-omit-frame-pointer -Werror -Wall -Wextra -Wformat -Werror=format-security -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-cast-function-type -fno-math-errno -fno-signed-zeros -Wall -O2 -fPIC -DPIC -I/usr/local/include -c gserialized.c -o gserialized.o >/dev/null 2>&1
topo/lwgeom_topo.c:5792:21: error: comparison of integer expressions of different signedness: 'int' and 'uint64_t' {aka 'long unsigned int'} [-Werror=sign-compare]
 5792 |     for ( int t=0; t<splitNodeEdges->numEdges; t++ )
      |                     ^
topo/lwgeom_topo.c:5920:21: error: comparison of integer expressions of different signedness: 'int' and 'uint64_t' {aka 'long unsigned int'} [-Werror=sign-compare]
 5920 |     for ( int t=0; t<lastNodeEdges->numEdges; t++ )
      |                     ^
topo/lwgeom_topo.c:6053:10: error: absolute value function 'abs' given an argument of type 'LWT_ELEMID' {aka 'long int'} but has parameter of type 'int' which may cause truncation of value [-Werror=absolute-value]
 6053 |     if ( abs(edge->next_right) == replacedBy[0] ) {
      |          ^~~
topo/lwgeom_topo.c:6070:21: error: comparison of integer expressions of different signedness: 'int' and 'uint64_t' {aka 'long unsigned int'} [-Werror=sign-compare]
 6070 |     for ( int t=0; t<firstNodeEdges->numEdges; t++ )
      |                     ^
libtool: compile:  gcc -I./../deps/ryu/.. -I/usr/local/include -I/usr/include/libxml2 -I/usr/local/include -I/usr/include/json-c -DNDEBUG -I. -I. -std=gnu99 -g -O2 -mtune=generic -fno-omit-frame-pointer -Werror -Wall -Wextra -Wformat -Werror=format-security -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-cast-function-type -fno-math-errno -fno-signed-zeros -Wall -O2 -fPIC -DPIC -I/usr/local/include -c lwpoly.c -o lwpoly.o >/dev/null 2>&1
topo/lwgeom_topo.c:6122:21: error: comparison of integer expressions of different signedness: 'int' and 'uint64_t' {aka 'long unsigned int'} [-Werror=sign-compare]
 6122 |     for ( int t=0; t<lastNodeEdges->numEdges; t++ )
      |                     ^
cc1: all warnings being treated as errors
make[1]: *** [Makefile:230: topo/lwt_edgeend_star.lo] Error 1

On Cirrhus FreeBSD 13 (but oddly bessie (64-bit) is showing no errors bessie32 as mentioned in another ticket is crashing, but gets past the compile phase

topo/lwgeom_topo.c:6053:10: error: absolute value function 'abs' given an argument of type 'LWT_ELEMID' (aka 'long') but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
    if ( abs(edge->next_right) == replacedBy[0] ) {
         ^
topo/lwgeom_topo.c:6053:10: note: use function 'labs' instead
    if ( abs(edge->next_right) == replacedBy[0] ) {
         ^~~
         labs
1 error generated.
gmake[1]: *** [Makefile:230: topo/lwgeom_topo.lo] Error 1
gmake[1]: Leaving directory '/tmp/cirrus-ci-build/liblwgeom'
gmake: *** [GNUmakefile:27: all] Error 1

Change History (3)

comment:1 by Sandro Santilli <strk@…>, 7 weeks ago

Resolution: fixed
Status: newclosed

In d64abc4/git:

Fix compiler warnings about signed/unsigned comparisons and abs() use

Closes #5729

comment:2 by Sandro Santilli <strk@…>, 7 weeks ago

In 98244e7/git:

More unsigned/signed comparison warning fixes

References #5729

comment:3 by strk, 7 weeks ago

GH actions are now happy, cirrus is still failing but is unrelated to topology, see #5730

Note: See TracTickets for help on using tickets.