enumerator value is not an integer constant

Bug #2047906 reported by Ivan Hu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Firmware Test Suite
Incomplete
High
Ivan Hu

Bug Description

got report from fwts github,
https://github.com/fwts/fwts/issues/13

Attempting to build 23.11.00 on Gentoo Linux with GCC 13

libtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../src/lib/include -I../../../src/libfwtsiasl -I../../../src/acpica/source/include -I../../../src/acpica/source/compiler -DDATAROOTDIR=\"/usr/share\" -Wall -Wextra -Wno-address-of-packed-member -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DACPI_DEBUG_OUTPUT -c fwts_firmware.c -fPIC -DPIC -o .libs/libfwts_la-fwts_firmware.o
In file included from ../../../src/lib/include/fwts_binpaths.h:27,
                 from ../../../src/lib/include/fwts.h:163,
                 from fwts_firmware.c:24:
fwts_firmware.c: In function 'fwts_firmware_feature_string':
../../../src/lib/include/fwts_framework.h:264:27: error: enumerator value for 'FWTS_ASSERT_str_too_small_in_line_93' is not an integer constant
  264 | enum { FWTS_CONCAT_EXPAND(FWTS_ASSERT_ ## m ## _in_line_, __LINE__) = 1 / !!(e) }
      | ^~~~~~~~~~~~
../../../src/lib/include/fwts_framework.h:261:27: note: in definition of macro 'FWTS_CONCAT'
  261 | #define FWTS_CONCAT(a, b) a ## b
      | ^
../../../src/lib/include/fwts_framework.h:264:8: note: in expansion of macro 'FWTS_CONCAT_EXPAND'
  264 | enum { FWTS_CONCAT_EXPAND(FWTS_ASSERT_ ## m ## _in_line_, __LINE__) = 1 / !!(e) }
      | ^~~~~~~~~~~~~~~~~~
fwts_firmware.c:93:9: note: in expansion of macro 'FWTS_ASSERT'
   93 | FWTS_ASSERT((n * (sizeof(feature_names[0].name) - 1)) +
      | ^~~~~~~~~~~
../../../src/lib/include/fwts_framework.h:264:27: error: enumerator value for 'FWTS_ASSERT_invalid_feature_names_in_line_98' is not an integer constant
  264 | enum { FWTS_CONCAT_EXPAND(FWTS_ASSERT_ ## m ## _in_line_, __LINE__) = 1 / !!(e) }
      | ^~~~~~~~~~~~
../../../src/lib/include/fwts_framework.h:261:27: note: in definition of macro 'FWTS_CONCAT'
  261 | #define FWTS_CONCAT(a, b) a ## b
      | ^
../../../src/lib/include/fwts_framework.h:264:8: note: in expansion of macro 'FWTS_CONCAT_EXPAND'
  264 | enum { FWTS_CONCAT_EXPAND(FWTS_ASSERT_ ## m ## _in_line_, __LINE__) = 1 / !!(e) }
      | ^~~~~~~~~~~~~~~~~~
fwts_firmware.c:98:9: note: in expansion of macro 'FWTS_ASSERT'
   98 | FWTS_ASSERT(((1UL << n) - 1) == FWTS_FW_FEATURE_ALL,
      | ^~~~~~~~~~~
make[4]: *** [Makefile:928: libfwts_la-fwts_firmware.lo] Error 1
make[4]: Leaving directory '/var/tmp/portage/sys-apps/fwts-23.11.00/work/fwts-23.11.00/src/lib/src'
make[3]: *** [Makefile:380: all-recursive] Error 1
make[3]: Leaving directory '/var/tmp/portage/sys-apps/fwts-23.11.00/work/fwts-23.11.00/src/lib'
make[2]: *** [Makefile:5141: all-recursive] Error 1
make[2]: Leaving directory '/var/tmp/portage/sys-apps/fwts-23.11.00/work/fwts-23.11.00/src'
make[1]: *** [Makefile:830: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/sys-apps/fwts-23.11.00/work/fwts-23.11.00'
make: *** [Makefile:761: all] Error 2

Revision history for this message
Ivan Hu (ivan.hu) wrote :

install the latest daily Ubuntu 24.04 (Noble) image, which hasn't no such build error.
gcc version 13.2.0(ubuntu 13.2.0-7ubuntu1)

Changed in fwts:
assignee: nobody → Ivan Hu (ivan.hu)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Ivan Hu (ivan.hu) wrote :

Will keep checking while encountering this issue in the newer GCC version available.

description: updated
Changed in fwts:
status: In Progress → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.