bbogush/nand_programmer

The Qt host application will not compile on gcc9 and newer

Opened this issue · 1 comments

Similar to #8 and still 100% reproducible on my system on the latest commit. Additionally, removing -Wextra -Werror in qt.pro has no effect, as you can see they still show up in the output. I have tested gcc6 all the way to gcc10, gcc8 is the last version that will build the host application.

$ make
/../lib64/qt5/bin/uic main_window.ui -o ../build/ui/ui_main_window.h
/../lib64/qt5/bin/uic parallel_chip_db_dialog.ui -o ../build/ui/ui_parallel_chip_db_dialog.h
/../lib64/qt5/bin/uic settings_programmer_dialog.ui -o ../build/ui/ui_settings_programmer_dialog.h
/../lib64/qt5/bin/uic about_dialog.ui -o ../build/ui/ui_about_dialog.h
/../lib64/qt5/bin/uic firmware_update_dialog.ui -o ../build/ui/ui_firmware_update_dialog.h
/../lib64/qt5/bin/uic spi_chip_db_dialog.ui -o ../build/ui/ui_spi_chip_db_dialog.h
g++ -c -pipe -std=c++11 -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I../build/moc -I../build/ui -I/../lib64/qt5/mkspecs/linux-g++ -o ../build/o/unix/main.o main.cpp
In file included from writer.h:9,
                 from programmer.h:12,
                 from main_window.h:9,
                 from main.cpp:6:
cmd.h:122:13: error: flexible array member ‘RespHeader::data’ not at end of ‘struct<unnamed>’
  122 |     uint8_t data[];
      |             ^~~~
cmd.h:128:15: note: next member ‘FwVersion <unnamed struct>::version’ declared here
  128 |     FwVersion version;
      |               ^~~~~~~
cmd.h:126:1: note: in the definition of ‘struct<unnamed>’
  126 | {
      | ^
cmd.h:122:13: error: flexible array member ‘RespHeader::data’ not at end of ‘struct<unnamed>’
  122 |     uint8_t data[];
      |             ^~~~
cmd.h:134:12: note: next member ‘ChipId <unnamed struct>::nandId’ declared here
  134 |     ChipId nandId;
      |            ^~~~~~
cmd.h:132:1: note: in the definition of ‘struct<unnamed>’
  132 | {
      | ^
cmd.h:122:13: error: flexible array member ‘RespHeader::data’ not at end of ‘struct<unnamed>’
  122 |     uint8_t data[];
      |             ^~~~
cmd.h:140:14: note: next member ‘uint32_t <unnamed struct>::addr’ declared here
  140 |     uint32_t addr;
      |              ^~~~
cmd.h:138:1: note: in the definition of ‘struct<unnamed>’
  138 | {
      | ^
cmd.h:122:13: error: flexible array member ‘RespHeader::data’ not at end of ‘struct<unnamed>’
  122 |     uint8_t data[];
      |             ^~~~
cmd.h:147:14: note: next member ‘uint32_t <unnamed struct>::ackBytes’ declared here
  147 |     uint32_t ackBytes;
      |              ^~~~~~~~
cmd.h:145:1: note: in the definition of ‘struct<unnamed>’
  145 | {
      | ^
cmd.h:122:13: error: flexible array member ‘RespHeader::data’ not at end of ‘struct<unnamed>’
  122 |     uint8_t data[];
      |             ^~~~
cmd.h:153:13: note: next member ‘uint8_t <unnamed struct>::errCode’ declared here
  153 |     uint8_t errCode;
      |             ^~~~~~~
cmd.h:151:1: note: in the definition of ‘struct<unnamed>’
  151 | {
      | ^
cmd.h:122:13: error: flexible array member ‘RespHeader::data’ not at end of ‘struct<unnamed>’
  122 |     uint8_t data[];
      |             ^~~~
cmd.h:159:14: note: next member ‘uint32_t <unnamed struct>::progress’ declared here
  159 |     uint32_t progress;
      |              ^~~~~~~~
cmd.h:157:1: note: in the definition of ‘struct<unnamed>’
  157 | {
      | ^
make: *** [Makefile:639: ../build/o/unix/main.o] Error 1

Fixed, removed flexible array usage.