Opened 5 years ago

Closed 5 years ago

#4527 closed defect (fixed)

Travis: error: unrecognized command line option '-Wno-unknown-warning-option' [-Werror]

Reported by: strk Owned by: Algunenano
Priority: blocker Milestone: PostGIS 3.0.0
Component: QA/buildbots Version: 2.5.x -- EOL
Keywords: Cc:

Description

See https://travis-ci.org/postgis/postgis/jobs/594444788#L1229

We seem to instruct Travis to pass that switch to compiler line:

ci/travis/run_tests.sh:5:WARNINGS_DISABLED="-Wno-unused-parameter -Wno-implicit-fallthrough -Wno-unknown-warning-option -Wno-cast-function-type"

But maybe it's not supported by the GCC used by travis ? It's gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 according to https://travis-ci.org/postgis/postgis/jobs/594444788#L29

Change History (5)

comment:1 by Algunenano, 5 years ago

The true error is right on top of that:

lwgeom_functions_basic.c: In function 'LWGEOM_makepoly':
/usr/local/pgsql/include/server/utils/array.h:305:21: error: operand of ?: changes signedness from 'int32' {aka 'int'} to 'long unsigned int' due to unsignedness of other operand [-Werror=sign-compare]
  305 |   (ARR_HASNULL(a) ? (a)->dataoffset : ARR_OVERHEAD_NONULLS(ARR_NDIM(a)))
      |                     ^~~~~~~~~~~~~~~
/usr/local/pgsql/include/server/utils/array.h:311:21: note: in expansion of macro 'ARR_DATA_OFFSET'
  311 |   (((char *) (a)) + ARR_DATA_OFFSET(a))
      |                     ^~~~~~~~~~~~~~~
lwgeom_functions_basic.c:1553:37: note: in expansion of macro 'ARR_DATA_PTR'
 1553 |    GSERIALIZED *g = (GSERIALIZED *)(ARR_DATA_PTR(array) + offset);
      |                                     ^~~~~~~~~~~~
In file included from lwgeom_geos.c:33:
lwgeom_geos.c: In function 'pgis_union_geometry_array':
/usr/local/pgsql/include/server/utils/array.h:305:21: error: operand of ?: changes signedness from 'int32' {aka 'int'} to 'long unsigned int' due to unsignedness of other operand [-Werror=sign-compare]
  305 |   (ARR_HASNULL(a) ? (a)->dataoffset : ARR_OVERHEAD_NONULLS(ARR_NDIM(a)))
      |                     ^~~~~~~~~~~~~~~
/usr/local/pgsql/include/server/postgres.h:556:38: note: in definition of macro 'PointerGetDatum'
  556 | #define PointerGetDatum(X) ((Datum) (X))
      |                                      ^
lwgeom_geos.c:397:3: note: in expansion of macro 'PG_RETURN_POINTER'
  397 |   PG_RETURN_POINTER((GSERIALIZED *)(ARR_DATA_PTR(array)));
      |   ^~~~~~~~~~~~~~~~~
/usr/local/pgsql/include/server/utils/array.h:311:21: note: in expansion of macro 'ARR_DATA_OFFSET'
  311 |   (((char *) (a)) + ARR_DATA_OFFSET(a))
      |                     ^~~~~~~~~~~~~~~
lwgeom_geos.c:397:37: note: in expansion of macro 'ARR_DATA_PTR'
  397 |   PG_RETURN_POINTER((GSERIALIZED *)(ARR_DATA_PTR(array)));
      |                                     ^~~~~~~~~~~~
lwgeom_geos.c: At top level:

This was changed in r17865

I don't know where GCC_VERSION comes from, but it isn't a predefined macro in my installation (gcc version 9.2.0).

comment:2 by Algunenano, 5 years ago

Owner: changed from robe to Algunenano

comment:3 by strk, 5 years ago

Why we'd want to ignore signedness in comparison I dunno, btw.

comment:4 by Algunenano, 5 years ago

Why we'd want to ignore signedness in comparison I dunno, btw.

That warning comes from Postgresql internal macros so it needs to be fixed there first (and then wait for all support for previous released to be dropped):

#define ARR_DATA_OFFSET(a) \
		(ARR_HASNULL(a) ? (a)->dataoffset : ARR_OVERHEAD_NONULLS(ARR_NDIM(a)))

/*
 * Returns a pointer to the actual array data.
 */
#define ARR_DATA_PTR(a) \
		(((char *) (a)) + ARR_DATA_OFFSET(a))

comment:5 by Raul Marin, 5 years ago

Resolution: fixed
Status: newclosed

In 17876:

Address compiler warnings

Closes #4527
Closes https://github.com/postgis/postgis/pull/490

Note: See TracTickets for help on using tickets.