URGENT: Cannot compile any mbed-os projects

17 Nov 2016

Something broke between yesterday and today that is preventing even the simplest of mbed-os projects from compiling.

Different target boards manifest the problems in slightly different ways but it appears what they all have in common is any code in the library that includes a variable declaration within the initial field of a for clause.

Any such code will cause two error messages in the form of:

  • Expected an expression "for (unsigned s = size; s; s >>= 1) {"
  • Identifier "s" is undefined "for (unsigned s = size; s; s >>= 1) {"

The issue can be easily duplicated by creating a new program with just an empty main function and import the mbed-os library.

Example:

  • target: NUCLEO-F411RE
  • library: ARMmbed/mbed-os Revision 2551:a1c0840

main.cpp

int main() {
}
18 Nov 2016

This has been resolved.