Something is wrong with bullet count

Good evening all.

I was testing my config & props with POS Github Master and I keep getting errors with bullet count.

I tried with Arduino 1.8.19 & plugin 3.6.0 & experimental 4.1.0
I also tried with Arduino 2.3.3 with both plugin versions.

This is my CONFIG_BOTTOM:
same as

It compiles with POS 7.14 but not with Github Master

#ifdef CONFIG_BOTTOM
    DisplayHelper<128, uint32_t,
    BaseLayerOp<StandardDisplayController>,
    ClearRectangleOp<10, 80, 8, 24>,
    WriteBulletCountOp<10, 20, 5> >
    display_controller;
    SSD1306Template<128, uint32_t> display(&display_controller);
#endif // CONFIG_BOTTOM

This is the errors I am getting from Arduino 2.3.3:

In file included from C:\ProffieOS\ProffieOS.ino:1688:
C:\ProffieOS\config\olicomplex1.5.010.2.h:1630:42: error: type/value mismatch at argument 1 in template parameter list for 'template<template<int <anonymous>, class> class T> struct BaseLayerOp'
 1630 |     BaseLayerOp<StandardDisplayController>,
      |                                          ^
C:\ProffieOS\config\olicomplex1.5.010.2.h:1630:42: note:   expected a template of type 'template<int <anonymous>, class> class T', got 'template<int Width, class col_t, class PREFIX> class StandardDisplayController'
C:\ProffieOS\config\olicomplex1.5.010.2.h:1633:35: error: template argument 3 is invalid
 1633 |     WriteBulletCountOp<10, 20, 5> >
      |                                   ^
C:\ProffieOS\config\olicomplex1.5.010.2.h:1635:63: error: no matching function for call to 'SSD1306Template<128, long unsigned int>::SSD1306Template(int*)'
 1635 |     SSD1306Template<128, uint32_t> display(&display_controller);
      |                                                               ^
In file included from C:\ProffieOS\ProffieOS.ino:1527:
C:\ProffieOS\display\ssd1306.h:1085:12: note: candidate: 'SSD1306Template<WIDTH, col_t, POWER_PIN>::SSD1306Template(DisplayControllerBase<Width, col_t>*, int) [with int WIDTH = 128; col_t = long unsigned int; POWER_PIN = PowerPINS<>]'
 1085 |   explicit SSD1306Template(DisplayControllerBase<WIDTH, col_t>* controller, int id) : I2CDevice(id) {
      |            ^~~~~~~~~~~~~~~
C:\ProffieOS\display\ssd1306.h:1085:12: note:   candidate expects 2 arguments, 1 provided
C:\ProffieOS\display\ssd1306.h:1082:12: note: candidate: 'SSD1306Template<WIDTH, col_t, POWER_PIN>::SSD1306Template(DisplayControllerBase<Width, col_t>*) [with int WIDTH = 128; col_t = long unsigned int; POWER_PIN = PowerPINS<>]'
 1082 |   explicit SSD1306Template(DisplayControllerBase<WIDTH, col_t>* controller) : I2CDevice(0x3C) {
      |            ^~~~~~~~~~~~~~~
C:\ProffieOS\display\ssd1306.h:1082:65: note:   no known conversion for argument 1 from 'int*' to 'DisplayControllerBase<128, long unsigned int>*'
 1082 |   explicit SSD1306Template(DisplayControllerBase<WIDTH, col_t>* controller) : I2CDevice(0x3C) {
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
C:\ProffieOS\display\ssd1306.h:1024:7: note: candidate: 'constexpr SSD1306Template<128, long unsigned int>::SSD1306Template(const SSD1306Template<128, long unsigned int>&)'
 1024 | class SSD1306Template : public Display<WIDTH, col_t>, I2CDevice, Looper, StateMachine {
      |       ^~~~~~~~~~~~~~~
C:\ProffieOS\display\ssd1306.h:1024:7: note:   no known conversion for argument 1 from 'int*' to 'const SSD1306Template<128, long unsigned int>&'
C:\ProffieOS\display\ssd1306.h:1024:7: note: candidate: 'constexpr SSD1306Template<128, long unsigned int>::SSD1306Template(SSD1306Template<128, long unsigned int>&&)'
C:\ProffieOS\display\ssd1306.h:1024:7: note:   no known conversion for argument 1 from 'int*' to 'SSD1306Template<128, long unsigned int>&&'

exit status 1

Compilation error: type/value mismatch at argument 1 in template parameter list for 'template<template<int <anonymous>, class> class T> struct BaseLayerOp'

So I guess something got changed along the way ?

Doesn’t this have an extra closing bracket?

It’s indented a little weird, but that should close the DisplayHelper template invocation.
I seem t recall having to change or fix something about display controllers in OS8, but I don’t remember what it was.

@olivierflying747-8 can you post the full config file. With that I can try compiling it and I should be able to figure it out.

Here is my shortened config (it gives the same errors)
olicomplex1.5.010.4.h (20.1 KB)

Thank you @profezzorn for looking into it.

At first, I thought so too but this is a copy paste from POD:

#ifdef CONFIG_BOTTOM

DisplayHelper<128, uint32_t,
  BaseLayerOp<StandardDisplayController>,
  ClearRectangleOp<10, 80, 8, 24>,
  WriteBulletCountOp<10, 20, 5>
> display_controller;

SSD1306Template<128, uint32_t> display(&display_controller);
#endif

I just moved the bracket one line up as it was making more sense to me.

It looks like this was an unintended consequence of me adding support for directory prefixes to the StandardDisplayController. I’m not sure why though since the prefix is optional…

Anyways, let’s see if I can fix it…

Ok, I think I have a fix.
It turns out that template template parameters needs their parameter lists to match exactly, it’s not enough that the templates are compatible with each other. This was surprising to me, but fortunately fairly easy to work around.

I was about to say cool but I tried to compile with the updates and now I get a whole lot of new errors from “…\display\rgb565frame.h”, using same config as above:

In file included from C:\ProffieOS\styles\display.h:5,
                 from C:\ProffieOS\ProffieOS.ino:511:
C:\ProffieOS\display\rgb565frame.h:55:44: error: expected class-name before ',' token
   55 | class PQOILayer : public BufferedFileReader, public LayerControl {
      |                                            ^
C:\ProffieOS\display\rgb565frame.h:55:66: error: expected class-name before '{' token
   55 | class PQOILayer : public BufferedFileReader, public LayerControl {
      |                                                                  ^
C:\ProffieOS\display\rgb565frame.h:369:37: error: 'VariableSource' has not been declared
  369 |   void LC_setVariable(int variable, VariableSource* variable_source) override {
      |                                     ^~~~~~~~~~~~~~
C:\ProffieOS\display\rgb565frame.h:445:3: error: 'VariableSource' does not name a type
  445 |   VariableSource *variables[5];
      |   ^~~~~~~~~~~~~~
C:\ProffieOS\display\rgb565frame.h: In member function 'bool PQOILayer<WIDTH, HEIGHT>::checklabel(uint32_t)':
C:\ProffieOS\display\rgb565frame.h:95:11: error: 'variables' was not declared in this scope; did you mean 'variable'?
   95 |       if (variables[variable - 'A']) {
      |           ^~~~~~~~~
      |           variable
C:\ProffieOS\display\rgb565frame.h: In member function 'void PQOILayer<WIDTH, HEIGHT>::run()':
C:\ProffieOS\display\rgb565frame.h:129:7: error: there are no arguments to 'SEEK' that depend on a template parameter, so a declaration of 'SEEK' must be available [-fpermissive]
  129 |       SEEK(frame_position_in_file_);
      |       ^~~~
C:\ProffieOS\display\rgb565frame.h:129:7: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
C:\ProffieOS\display\rgb565frame.h:134:27: error: there are no arguments to 'TELL' that depend on a template parameter, so a declaration of 'TELL' must be available [-fpermissive]
  134 |       if (next_header_ && TELL() != next_header_) {
      |                           ^~~~
C:\ProffieOS\display\rgb565frame.h:135:48: error: there are no arguments to 'TELL' that depend on a template parameter, so a declaration of 'TELL' must be available [-fpermissive]
  135 |         STDERR << "Length mismatch, pos = " << TELL() << " expected = " << next_header_ << "\n";
      |                                                ^~~~
C:\ProffieOS\display\rgb565frame.h:145:17: error: 'input_buffer_' was not declared in this scope
  145 |         while (!input_buffer_.size()) {
      |                 ^~~~~~~~~~~~~
C:\ProffieOS\display\rgb565frame.h:147:15: error: there are no arguments to 'ATEOF' that depend on a template parameter, so a declaration of 'ATEOF' must be available [-fpermissive]
  147 |           if (ATEOF()) {
      |               ^~~~~
C:\ProffieOS\display\rgb565frame.h:153:11: error: there are no arguments to 'scheduleFillBuffer' that depend on a template parameter, so a declaration of 'scheduleFillBuffer' must be available [-fpermissive]
  153 |           scheduleFillBuffer();
      |           ^~~~~~~~~~~~~~~~~~
C:\ProffieOS\display\rgb565frame.h:157:53: error: 'input_buffer_' was not declared in this scope
  157 |         size_t to_copy = min(read_end_ - read_pos_, input_buffer_.continuous_data());
      |                                                     ^~~~~~~~~~~~~
C:\ProffieOS\display\rgb565frame.h:172:29: error: there are no arguments to 'TELL' that depend on a template parameter, so a declaration of 'TELL' must be available [-fpermissive]
  172 |                << " @ " << (TELL() - 16)
      |                             ^~~~
C:\ProffieOS\display\rgb565frame.h:175:22: error: there are no arguments to 'TELL' that depend on a template parameter, so a declaration of 'TELL' must be available [-fpermissive]
  175 |       next_header_ = TELL() + header_.length - 8;
      |                      ^~~~
C:\ProffieOS\display\rgb565frame.h:205:72: error: there are no arguments to 'TELL' that depend on a template parameter, so a declaration of 'TELL' must be available [-fpermissive]
  205 |         STDERR << "Invalid header = " << header_.magic << " pos = " << TELL() << " FILE = " << file_.GetFilename() << "\n";
      |                                                                        ^~~~
C:\ProffieOS\display\rgb565frame.h:205:96: error: 'file_' was not declared in this scope
  205 |         STDERR << "Invalid header = " << header_.magic << " pos = " << TELL() << " FILE = " << file_.GetFilename() << "\n";
      |                                                                                                ^~~~~
C:\ProffieOS\display\rgb565frame.h:210:72: error: there are no arguments to 'TELL' that depend on a template parameter, so a declaration of 'TELL' must be available [-fpermissive]
  210 |         STDERR << "Unknown header = " << header_.magic << " pos = " << TELL() << " FILE = " << file_.GetFilename() << "\n";
      |                                                                        ^~~~
C:\ProffieOS\display\rgb565frame.h:210:96: error: 'file_' was not declared in this scope
  210 |         STDERR << "Unknown header = " << header_.magic << " pos = " << TELL() << " FILE = " << file_.GetFilename() << "\n";
      |                                                                                                ^~~~~
C:\ProffieOS\display\rgb565frame.h:211:9: error: there are no arguments to 'SEEK' that depend on a template parameter, so a declaration of 'SEEK' must be available [-fpermissive]
  211 |         SEEK(next_header_);
      |         ^~~~
C:\ProffieOS\display\rgb565frame.h:231:35: error: there are no arguments to 'ATEOF' that depend on a template parameter, so a declaration of 'ATEOF' must be available [-fpermissive]
  231 |     if (micros_per_frame_ == 0 || ATEOF()) goto frame_found;
      |                                   ^~~~~
C:\ProffieOS\display\rgb565frame.h:244:10: error: there are no arguments to 'TELL' that depend on a template parameter, so a declaration of 'TELL' must be available [-fpermissive]
  244 |     SEEK(TELL() + header_.length - 8);
      |          ^~~~
C:\ProffieOS\display\rgb565frame.h:252:31: error: there are no arguments to 'TELL' that depend on a template parameter, so a declaration of 'TELL' must be available [-fpermissive]
  252 |     frame_position_in_file_ = TELL();
      |                               ^~~~
C:\ProffieOS\display\rgb565frame.h: In member function 'bool PQOILayer<WIDTH, HEIGHT>::SelectFrame(Cyclint<long unsigned int>)':
C:\ProffieOS\display\rgb565frame.h:266:9: error: 'file_' was not declared in this scope
  266 |         file_.do_open();
      |         ^~~~~
C:\ProffieOS\display\rgb565frame.h:267:9: error: there are no arguments to 'SEEK' that depend on a template parameter, so a declaration of 'SEEK' must be available [-fpermissive]
  267 |         SEEK(0);
      |         ^~~~
C:\ProffieOS\display\rgb565frame.h: In member function 'bool PQOILayer<WIDTH, HEIGHT>::Fill(OutputBuffer<WIDTH>*)':
C:\ProffieOS\display\rgb565frame.h:311:12: error: 'input_buffer_' was not declared in this scope; did you mean 'output_buffer'?
  311 |       if (!input_buffer_.size()) scheduleFillBuffer();
      |            ^~~~~~~~~~~~~
      |            output_buffer
C:\ProffieOS\display\rgb565frame.h:311:34: error: there are no arguments to 'scheduleFillBuffer' that depend on a template parameter, so a declaration of 'scheduleFillBuffer' must be available [-fpermissive]
  311 |       if (!input_buffer_.size()) scheduleFillBuffer();
      |                                  ^~~~~~~~~~~~~~~~~~
C:\ProffieOS\display\rgb565frame.h:312:12: error: 'input_buffer_' was not declared in this scope; did you mean 'output_buffer'?
  312 |       if (!input_buffer_.size()) return false;
      |            ^~~~~~~~~~~~~
      |            output_buffer
C:\ProffieOS\display\rgb565frame.h:313:35: error: 'input_buffer_' was not declared in this scope; did you mean 'output_buffer'?
  313 |       output_buffer->fill(&pqoi, &input_buffer_, left_margin_, width_);
      |                                   ^~~~~~~~~~~~~
      |                                   output_buffer
C:\ProffieOS\display\rgb565frame.h: In member function 'bool PQOILayer<WIDTH, HEIGHT>::Apply(OutputBuffer<WIDTH>*, uint16_t*&)':
C:\ProffieOS\display\rgb565frame.h:348:12: error: 'input_buffer_' was not declared in this scope; did you mean 'output_buffer'?
  348 |       if (!input_buffer_.size()) scheduleFillBuffer();
      |            ^~~~~~~~~~~~~
      |            output_buffer
C:\ProffieOS\display\rgb565frame.h:348:34: error: there are no arguments to 'scheduleFillBuffer' that depend on a template parameter, so a declaration of 'scheduleFillBuffer' must be available [-fpermissive]
  348 |       if (!input_buffer_.size()) scheduleFillBuffer();
      |                                  ^~~~~~~~~~~~~~~~~~
C:\ProffieOS\display\rgb565frame.h:349:12: error: 'input_buffer_' was not declared in this scope; did you mean 'output_buffer'?
  349 |       if (!input_buffer_.size()) return false;
      |            ^~~~~~~~~~~~~
      |            output_buffer
C:\ProffieOS\display\rgb565frame.h:350:22: error: 'input_buffer_' was not declared in this scope; did you mean 'output_buffer'?
  350 |       pqoi.set_input(input_buffer_.data(), input_buffer_.data() + input_buffer_.continuous_data());
      |                      ^~~~~~~~~~~~~
      |                      output_buffer
In file included from C:\ProffieOS\common\capabilities.h:4,
                 from C:\ProffieOS\ProffieOS.ino:38:
C:\ProffieOS\display\rgb565frame.h: In member function 'void PQOILayer<WIDTH, HEIGHT>::LC_setVariable(int, int*)':
C:\ProffieOS\display\rgb565frame.h:371:43: error: 'variables' was not declared in this scope; did you mean 'variable'?
  371 |     if (variable < 0 || variable >= NELEM(variables)) {
      |                                           ^~~~~~~~~
C:\ProffieOS\common\common.h:18:26: note: in definition of macro 'NELEM'
   18 | #define NELEM(X) (sizeof(X)/sizeof((X)[0]))
      |                          ^
C:\ProffieOS\display\rgb565frame.h:375:5: error: 'variables' was not declared in this scope; did you mean 'variable'?
  375 |     variables[variable] = variable_source;
      |     ^~~~~~~~~
      |     variable
C:\ProffieOS\display\rgb565frame.h: In member function 'const char* PQOILayer<WIDTH, HEIGHT>::LC_get_filename()':
C:\ProffieOS\display\rgb565frame.h:378:12: error: 'file_' was not declared in this scope
  378 |     return file_.GetFilename();
      |            ^~~~~
C:\ProffieOS\display\rgb565frame.h: In member function 'const void PQOILayer<WIDTH, HEIGHT>::LC_restart()':
C:\ProffieOS\display\rgb565frame.h:382:5: error: there are no arguments to 'SEEK' that depend on a template parameter, so a declaration of 'SEEK' must be available [-fpermissive]
  382 |     SEEK(0);
      |     ^~~~
C:\ProffieOS\display\rgb565frame.h: In member function 'void PQOILayer<WIDTH, HEIGHT>::LC_play(const char*)':
C:\ProffieOS\display\rgb565frame.h:387:5: error: 'file_' was not declared in this scope
  387 |     file_.PlayInternal(filename);
      |     ^~~~~
C:\ProffieOS\display\rgb565frame.h: In member function 'void PQOILayer<WIDTH, HEIGHT>::dumpstate()':
C:\ProffieOS\display\rgb565frame.h:402:28: error: 'file_' was not declared in this scope
  402 |            << " File: " << file_.GetFilename()
      |                            ^~~~~
C:\ProffieOS\display\rgb565frame.h:404:27: error: there are no arguments to 'TELL' that depend on a template parameter, so a declaration of 'TELL' must be available [-fpermissive]
  404 |            << " POS: " << TELL()
      |                           ^~~~
C:\ProffieOS\display\rgb565frame.h:405:27: error: there are no arguments to 'ATEOF' that depend on a template parameter, so a declaration of 'ATEOF' must be available [-fpermissive]
  405 |            << " EOF: " << ATEOF()
      |                           ^~~~~
C:\ProffieOS\display\rgb565frame.h:406:28: error: there are no arguments to 'kbps' that depend on a template parameter, so a declaration of 'kbps' must be available [-fpermissive]
  406 |            << " KBPS: " << kbps()
      |                            ^~~~
C:\ProffieOS\display\rgb565frame.h:407:31: error: 'input_buffer_' was not declared in this scope
  407 |            << " Bufsize: " << input_buffer_.size()
      |                               ^~~~~~~~~~~~~
C:\ProffieOS\display\rgb565frame.h: At global scope:
C:\ProffieOS\display\rgb565frame.h:458:53: error: expected template-name before '<' token
  458 | class RGB565Frame : public SizedLayeredScreenControl<WIDTH, HEIGHT> {
      |                                                     ^
C:\ProffieOS\display\rgb565frame.h:458:53: error: expected '{' before '<' token

exit status 1

Compilation error: expected class-name before ',' token

Sorry for the “bad news”.

Looks like I forgot to check in one small change…
Should be fixed now.

Using Anakin’s child-voice: “It’s working, it’s working!”

Cool. Thank you for your time.

With plugins 4.1.0 experimental & “standard”:

c:/users/olivier/appdata/local/arduino15/packages/proffieboard_experimental/tools/arm-none-eabi-gcc/12-3-rel1/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe:C:\Users\Olivier\AppData\Local\Arduino15\packages\proffieboard_experimental\hardware\stm32l4\4.1.0\variants\STM32L452RE-ProffieboardV3/linker_scripts/STM32L452RE_FLASH.ld:224: warning: memory region `SRAM2' not declared
lto-wrapper.exe: warning: using serial compilation of 8 LTRANS jobs
lto-wrapper.exe: note: see the '-flto' option documentation for more information
Sketch uses 260560 bytes (51%) of program storage space. Maximum is 507904 bytes.


c:/users/olivier/appdata/local/arduino15/packages/proffieboard/tools/arm-none-eabi-gcc/12-3-rel1/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe:C:\Users\Olivier\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\4.1\variants\STM32L452RE-ProffieboardV3/linker_scripts/STM32L452RE_FLASH.ld:224: warning: memory region `SRAM2' not declared
lto-wrapper.exe: warning: using serial compilation of 8 LTRANS jobs
lto-wrapper.exe: note: see the '-flto' option documentation for more information
Sketch uses 260560 bytes (51%) of program storage space. Maximum is 507904 bytes.

I have just some questions about the results:

  1. What is “warning: memory region `SRAM2’ not declared” ?
  2. What is “warning: using serial compilation of 8 LTRANS jobs” ?
  3. What is “see the ‘-flto’ option documentation for more information” ?

I do not like to see “warnings” especially when I do not know/understand them & I am always happy to check more documentation for more information. :stuck_out_tongue_winking_eye:

I think I caused this one. I got rid of the SRAM2 definition in the linker script a long time ago. It doesn’t seem to hurt anything, and I’m not entirely sure how to fix it.

I don’t know why GCC thinks this deserves a warning.
There is a flag that makes it do the 8 jobs in parallel, but that flag only works for some versions of GCC, so I’m reluctant to use it.

Also, GCC decided to split the job into 8 pieces, not me…

This is just more context for (2) above.

And just like Anakins builds, it might blow up when you use it… :slight_smile:

1 Like

Good, good (using the emperor’s voice), so nothing to worry about.

I guess I don’t mind this kind of warnings.

Yes but what do I need to do to access “more context” ?

His pod-racer didn’t blow up, or did it ?

But if it does blow up, I am sure we can all count on you to help fix it… :grin:

1 Like

Google it?

1 Like

You are right, I should have Googled it. Sorry about that.

However, I did not ask the question correctly.
What was/is on my mind is: how/where do I add gcc -o myprog -flto -O2 foo.o bar.o in Arduino, or in ProffieOS.ino or where/how-ever it needs to be added to get additional “context” ? If at all possible ?

Or maybe it will just give me more gibberish that I will never be able to understand ?

I’m not quite sure what you mean.
The boards.txt and platform.txt files in the arduino-proffieboard module specifies what command lines to actually use when compiling if that’s what you mean.

Let me try again.

So I compile a config in Arduino. It is successful and I get this message:
lto-wrapper.exe: note: see the '-flto' option documentation for more information
The link you provided above points to this:
"-flto[=n]

This option runs the standard link-time optimizer. When invoked with source code, it generates GIMPLE (one of GCC’s internal representations) and writes it to special ELF sections in the object file. When the object files are linked together, all the function bodies are read from these ELF sections and instantiated as if they had been part of the same translation unit.

To use the link-time optimizer, -flto and optimization options should be specified at compile time and during the final link. It is recommended that you compile all the files participating in the same link with the same options and also specify those options at link time. For example:

gcc -c -O2 -flto foo.c
gcc -c -O2 -flto bar.c
gcc -o myprog -flto -O2 foo.o bar.o

The first two invocations to GCC save a bytecode representation of GIMPLE into special ELF sections inside foo.o and bar.o. The final invocation reads the GIMPLE bytecode from foo.o and bar.o, merges the two files into a single internal image, and compiles the result as usual. Since both foo.o and bar.o are merged into a single image, this causes all the interprocedural analyses and optimizations in GCC to work across the two files ... (lots more more stuff)."
  1. So is this the “more information” and that’s it ?
  2. or is “-flto” meant to be used or added somewhere as a part of a line of code that would give us “more information” about the config/ProffieOS compilation ?

If it is 1, then why is Arduino saying this ?
If it is 2, then where do I add “-flto” to get more information.

I tried in ProffieOS.ino
#define CONFIG_FILE "config/olicomplex1.5.010.1.h" -lfto but that only produces this error code:

C:\Users\Olivier\Desktop\LightSabers\ProffieOS_for_Oli-experiments\ProffieOS_for_Oli-experiments.ino: In member function 'virtual bool Commands::Parse(const char*, const char*)':
C:\Users\Olivier\Desktop\LightSabers\ProffieOS_for_Oli-experiments\ProffieOS_for_Oli-experiments.ino:8:53: error: 'flto' was not declared in this scope
    8 | #define CONFIG_FILE "config/olicomplex1.5.010.1.h" -flto
      |                                                     ^~~~
C:\Users\Olivier\Desktop\LightSabers\ProffieOS_for_Oli-experiments\ProffieOS_for_Oli-experiments.ino:1228:22: note: in expansion of macro 'CONFIG_FILE'
 1228 |              << "\n" CONFIG_FILE "\nprop: " TOSTRING(PROP_TYPE) "\nbuttons: " TOSTRING(NUM_BUTTONS) "\ninstalled: "
      |                      ^~~~~~~~~~~

exit status 1

Compilation error: 'flto' was not declared in this scope

So it is not it.

Is my question clearer now ? I am just confused as to why there is that message if “-flto” can’t be added in some part of the code.

Yes

Don’t know, there may be more somewhere.

Arduino isn’t saying this, gcc is. gcc is saying it because of a flag which is controlled by settings.txt/platforms.txt inside the arduino-proffieboard plugin.

Eh? That’s not how any of this works.

  • The flag is -flto not -lfto (lto stands for “link time optimization” and -f is a flag for enabling/disabling compiler optimizations.)
  • The flag is applied to the compiler command line, not inside the code

tl;dr; the message is for me, not you, please ignore it.

Ok, thanks. I will ignore it.

Yes, I meant -flto, I am slightly dyslexic sometimes, and/or I type faster with right index finger than left index finger.

getting a warning of a re-definition of #define ONCE_PER_EFFECT(X) in both layer_controller.h and ssd1306.h