Error with Flash library

I’ve been using the Flash library (http://github.com/schinken/Flash) successfully in a project for quite some time now.

I opened the project up today, and get an error on compilation. It seems that when I try to use the library’s FLASH_TABLE, I get an “internal compiler error”. Other kinds of structures in the library seem to work.
Here is a minimal sketch that shows the error:

#include <Flash.h>

FLASH_TABLE(int, foo, 1, {0});
    
void setup() {
}

void loop() {
}

and here’s the error message:

In file included from /var/folders/nj/403w63_510l7xxn7v_vf7tk80000gn/T/arduino_modified_sketch_180130/sketch_feb18a.ino:1:0:
/Users/jeffreylefstin/Documents/Arduino/libraries/Flash/src/Flash.h: In instantiation of 'void _FLASH_TABLE<T>::print(Print&) const [with T = int]':
/var/folders/nj/403w63_510l7xxn7v_vf7tk80000gn/T/arduino_modified_sketch_180130/sketch_feb18a.ino:9:1:   required from here
/Users/jeffreylefstin/Documents/Arduino/libraries/Flash/src/Flash.h:182:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<_rows; ++i)
                    ^
/Users/jeffreylefstin/Documents/Arduino/libraries/Flash/src/Flash.h: In instantiation of 'class _FLASH_ARRAY<int>':
/Users/jeffreylefstin/Documents/Arduino/libraries/Flash/src/Flash.h:184:23:   required from 'void _FLASH_TABLE<T>::print(Print&) const [with T = int]'
/var/folders/nj/403w63_510l7xxn7v_vf7tk80000gn/T/arduino_modified_sketch_180130/sketch_feb18a.ino:9:1:   required from here
/Users/jeffreylefstin/Documents/Arduino/libraries/Flash/src/Flash.h:116:21: internal compiler error: in type_hash_canon, at tree.c:6953
   typedef T PROGMEM _DataType;
                     ^
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
exit status 1
Error compiling for board Arduino/Genuino Uno.

Any ideas?

It looks like a known issue with that library. It's discussed here at the library's github page.

I wonder if it's related to this?:

Here's the workaround for this issue:

  • Tools > Board > Boards Manager
  • Wait for downloads to finish.
  • When you move the mouse pointer over "Arduino AVR Boards", you will see a "Select version" dropdown menu appear. Select "1.6.21".
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".

Due to a bug, this workaround doesn't work with Arduino IDE 1.8.6, but it will work with any other version of the Arduino IDE.

If you have File > Preferences > Check for updates on startup checked, the Arduino IDE may occasionally notify you that a new version of Arduino AVR Boards is available, you'll need to refrain from updating back to the new Arduino AVR Boards version, otherwise you'll be back to seeing the segmentation fault error again.

Thank you pert, reverting to 1.6.21 allows compilation again!

You're welcome. I'm glad to hear it's working now. Enjoy!
Per