Skip to content

suggest explicit braces to avoid ambiguous 'else' [-Werror=dangling-else] #10

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

Closed
Marco1971Repo opened this issue Feb 26, 2024 · 1 comment

Comments

@Marco1971Repo
Copy link
Contributor

Marco1971Repo commented Feb 26, 2024

Error in title compiling main stream:

for (auto &tmp : spi) {
      AD_LOGD("DriverPins::begin::SPI::begin");
      if (tmp.function == PinFunction::SD)
        if (sd_active)
          result &= tmp.begin();
      else
        result &= tmp.begin();
    }

I think that adding braces make code cleaer effectively

   for (auto &tmp : spi) {
      AD_LOGD("DriverPins::begin::SPI::begin");
      if (tmp.function == PinFunction::SD)
      {
        if (sd_active)
          result &= tmp.begin();
      else
        result &= tmp.begin();
      }
    }
@pschatzmann
Copy link
Owner

Feel free to submit a pull request

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

No branches or pull requests

2 participants