Bug in the Arduino Compiler?

I’ve discovered a bug in the Arduino IDE/avr-gcc compiler.

Specifically

  template<typename T>
  T Min(const T & left, const T & right)
  {
    return (left < right) ? left : right;
  }

Reports an error of 'T' does not name a type.
Oddly wrapping it in a namespace or writing it like this:

  template<typename T> T Min(const T & left, const T & right)
  {
    return (left < right) ? left : right;
  }

Fixes the error.

So my questions are:
A) Does anyone else have this problem?
and
B) Does anybody know how to report a bug in the Arduino IDE?

Arduino uses the Gnu GCC compiler suite. If you think there’s a bug in the compiler, you should report it to GCC, not Arduino.

https://gcc.gnu.org/bugs/

2 Likes

Turn on verbose compilation in the IDE to get the command line. This will allow you to run that command to get the version # if it’s not reported directly, which the GNU folk will want.

IIRC, on Unix systems the IDE will use the system version of avr-gcc if there’s one installed. You can check that as well, and possibly delete or update that version if so.

2 Likes