Project

General

Profile

Bug #5004

More fallout from -std=gnu11 on debian8

Added by osmith 9 months ago. Updated 9 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
02/02/2021
Due date:
% Done:

100%

Spec Reference:

Description

After libosmocore is fixed (#4991), osmo-bts and libosmo-sccp are failing with similar "error: initializer element is not constant" errors.

I'll fix it and verify that all packages build for debian8 now, as we might get that with other packages as well.


Related issues

Related to libosmocore - Bug #4991: fails to build on OBS/debian 8Resolved01/29/2021

Associated revisions

Revision d4998abd (diff)
Added by osmith 9 months ago

xua_msg: fix gcc 4 + -std=gnu11 error

Fix 'error: initializer element is not constant' with debian 8's gcc
4.9.2, triggered by XUA_HDR. Create a new _XUA_HDR without the type cast,
and use it inside of const struct definitions (xua_test.c). The new
macro is needed, because removing the type cast from the original
XUA_HDR would break other uses.

Related: OS#5004
Change-Id: I890432ee976043d012b01023f7dd2cfecf79d115

Revision 23ff5f88 (diff)
Added by osmith 9 months ago

common/measurement.c: fix gcc 4 + -std=gnu11 error

GCC-4 doesn't like static const struct foo bar = (struct foo)...:
measurement.c:33:1: error: initializer element is not constant

Related: OS#5004
Change-Id: Iec5a4006dfc90abe240fcf8b6c2fefd4f7071a70

Revision 20642478 (diff)
Added by osmith 9 months ago

xua_test: fix gcc 4 + -std=gnu11 error

Fix 'error: initializer element is not constant' with debian 8's gcc
4.9.2, triggered by XUA_HDR. Create a new _XUA_HDR without the type cast,
and use it inside of const struct definitions in xua_test.c. The new
macro is needed, because removing the type cast from the original
XUA_HDR would break other uses.

Related: OS#5004
Change-Id: I890432ee976043d012b01023f7dd2cfecf79d115

History

#1 Updated by osmith 9 months ago

  • Related to Bug #4991: fails to build on OBS/debian 8 added

#2 Updated by osmith 9 months ago

libosmo-sccp fails with:

[  173s]   CC       xua_test.o
[  173s] In file included from ../../include/../src/xua_internal.h:4:0,
[  173s]                  from xua_test.c:21:
[  173s] ../../include/osmocom/sigtran/xua_msg.h:25:39: error: initializer element is not constant
[  173s]  #define XUA_HDR(class, type) ((struct xua_common_hdr) { .spare = 0, .msg_class = (class), .msg_type = (type) })
[  173s]                                        ^
[  173s] xua_test.c:387:11: note: in expansion of macro 'XUA_HDR'
[  173s]     .hdr = XUA_HDR(SUA_MSGC_CL, SUA_CL_CLDT),
[  173s]            ^
[  173s] ../../include/osmocom/sigtran/xua_msg.h:25:39: error: (near initialization for 'sccp2sua_testcases[0].sua.hdr')
[  173s]  #define XUA_HDR(class, type) ((struct xua_common_hdr) { .spare = 0, .msg_class = (class), .msg_type = (type) })
[  173s]                                        ^
[  173s] xua_test.c:387:11: note: in expansion of macro 'XUA_HDR'
[  173s]     .hdr = XUA_HDR(SUA_MSGC_CL, SUA_CL_CLDT),
[  173s]            ^
[  173s] Makefile:381: recipe for target 'xua_test.o' failed

osmo-bts fails with:

[  167s]   CC       measurement.o
[  167s] measurement.c:33:1: error: initializer element is not constant
[  167s]  };
[  167s]  ^

#3 Updated by osmith 9 months ago

  • % Done changed from 0 to 20

#4 Updated by laforge 9 months ago

maybe c11 was a bit too new, after all. I explicitly commented on that, but then
stated "ok" as it was generally understood that C11 is supported everywhere :P

#5 Updated by osmith 9 months ago

  • % Done changed from 20 to 90

Well, the good news is that there are no more failures besides the libosmocore osmo-bts and libosmo-sccp errors.

https://build.opensuse.org/project/monitor/home:osmith42?defaults=0&succeeded=1&failed=1&unresolvable=1&broken=1&blocked=1&dispatching=1&scheduled=1&building=1&finished=1&signing=1&locked=1&deleting=1&unknown=1&arch_i586=1&repo_Debian_8_0=1

I'll update the libosmo-sccp patch and test it again.

#6 Updated by osmith 9 months ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)