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

Avoid warning about missing return #794

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

SimonFJ20
Copy link
Contributor

When compiling a sketch with Mbed OPTA board selected, you get the following warning, if you have enabled All compiler warnings.

/home/simon/.arduino15/packages/arduino/hardware/mbed_opta/4.0.10/variants/OPTA/variant.cpp: In member function 'virtual int SecureQSPIFBlockDevice::programSecure(void*, mbed::bd_addr_t, mbed::bd_size_t)':
/home/simon/.arduino15/packages/arduino/hardware/mbed_opta/4.0.10/variants/OPTA/variant.cpp:266:5: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^
/home/simon/.arduino15/packages/arduino/hardware/mbed_opta/4.0.10/variants/OPTA/variant.cpp: In member function 'virtual int SecureQSPIFBlockDevice::eraseSecure(void*, mbed::bd_addr_t, mbed::bd_size_t)':
/home/simon/.arduino15/packages/arduino/hardware/mbed_opta/4.0.10/variants/OPTA/variant.cpp:269:5: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^

To remove this warning there are 2 options:

  1. Return some value
  2. Use GCC #pragma directive to turn off warnings temporarily

I chose the first option, but a comment right above the class says // 256byte secure OTP area (on AT25SF128A), and I'm not sure if this means that the class/function definitions will produce too large outputs (>256). In which case, option 2 should be used instead IMO.

@CLAassistant
Copy link

CLAassistant commented Dec 8, 2023

CLA assistant check
All committers have signed the CLA.

@facchinm facchinm merged commit 600a830 into arduino:main Jan 9, 2024
11 checks passed
@facchinm
Copy link
Member

facchinm commented Jan 9, 2024

Merged, thank you!

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.

3 participants