Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Handle gcc unsupported __VA_OPT___ macro (#1880) #1881

Conversation

tonhuisman
Copy link
Contributor

@tonhuisman tonhuisman commented Sep 16, 2022

Resolves #1880

Add check to see if __VA_OPT__ macro is supported, if not, applies <true_result> value for COND() macro by default.

This has the side-effect/limitation that all protocol names are included in the build, even if the protocol is not available in the code, but only for compilers dat do not support the __VA_OPT__ macro, notably gcc 4.8.2 (and older).

@tonhuisman
Copy link
Contributor Author

tonhuisman commented Sep 16, 2022

Not sure how I can fix this:

../src/IRmacros.h:15:9: error: __VA_OPT__ can only appear in the expansion of a C++2a variadic macro [-Werror]

versus (previous build):

../src/IRmacros.h:43:13: error: __VA_OPT__ can only appear in the expansion of a C++2a variadic macro [-Werror]

🤔
Edit:
NB: I would have expected to also these errors when compiling on Windows/locally, do the pio configurations need an update?

src/IRmacros.h Outdated Show resolved Hide resolved
@s-hadinger
Copy link
Contributor

Confirmed working in Tasmota for both esp8266 and esp32. Thanks a lot

Comment the specific points of the `#if` preprocessort statements
Copy link
Owner

@crankyoldgit crankyoldgit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@crankyoldgit crankyoldgit merged commit c5dacad into crankyoldgit:master Sep 18, 2022
crankyoldgit added a commit that referenced this pull request Sep 18, 2022
**_v2.8.4 (20220918)_**

**[Bug Fixes]**
 - [Bugfix] Handle gcc unsupported __VA_OPT___ macro (#1880 #1881)
@crankyoldgit crankyoldgit mentioned this pull request Sep 18, 2022
@tonhuisman tonhuisman deleted the bugfix/handle-gcc-not-supporting_va_opt_macro branch September 18, 2022 08:16
crankyoldgit added a commit that referenced this pull request Sep 18, 2022
**_v2.8.4 (20220918)_**

**[Bug Fixes]**
 - [Bugfix] Handle gcc unsupported `__VA_OPT___` macro (#1880 #1881)
@crankyoldgit
Copy link
Owner

v2.8.4 has been released which includes this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v2.8.3 does not compile anymore with gcc 4.8.2 (used by Tasmota for ESP8266)
4 participants