You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.
In the Arduino WString.h header, the F() macro is defined to allow strings to be put in flash (saving precious SRAM).
At the end of boost/config/platform/avr.hpp is the following snippet:
// Defined by arduino/wiring WString.h
#ifdef F
#undef F
#endif
This means that the F() macro no longer works, and produces compilation errors: error: ‘F’ was not declared in this scope
What is the reason for undefining the macro? At the very least, the explicit reason why F() is undefined should be documented, and what to do about it if you need to use the F() macro
The text was updated successfully, but these errors were encountered:
I assume the reason is that boost uses F as an identifier (e.g. variable name or template argument) in a ton of places, so keeping it defined will break parsing of all those places. It's a bit annoying that Arduino uses such a short macro, but we'll have to deal with it anyway. One alternative to undeffing the macro is to use the push_macro and pop_macro pragmas, though I'm not sure how portable or future-proof that is (gcc documents "For compatibility with Microsoft Windows compilers, GCC supports ‘#pragma push_macro("macro_name")’"
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In the Arduino WString.h header, the F() macro is defined to allow strings to be put in flash (saving precious SRAM).
At the end of boost/config/platform/avr.hpp is the following snippet:
This means that the F() macro no longer works, and produces compilation errors:
error: ‘F’ was not declared in this scope
What is the reason for undefining the macro? At the very least, the explicit reason why F() is undefined should be documented, and what to do about it if you need to use the F() macro
The text was updated successfully, but these errors were encountered: