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

[Gen2] Fix sprintf compile err on gcc9 #2122

Merged
merged 3 commits into from
Jun 4, 2020

Conversation

keeramis
Copy link
Contributor

@keeramis keeramis commented Jun 2, 2020

Problem

Compile error when building Electron after updating to gcc compiler 9.2.1

error: 'sprintf' may write a terminating nul past the end of the destination

Solution

Use snprintf instead of sprintf to give number of bytes.

Steps to Test

Compiling Electron on gcc 9.2.1 likely triggers this error.

Example App

void setup() {
}

void loop() {
}

References

ch55930


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@keeramis
Copy link
Contributor Author

keeramis commented Jun 2, 2020

Worked with Julien and made sure we are also fixing the buffer sizes allocated for the bands.

@avtolstoy avtolstoy added this to the 2.0.0 milestone Jun 3, 2020
@avtolstoy avtolstoy added ready to merge PR has been reviewed and tested internal labels Jun 3, 2020
@keeramis keeramis force-pushed the ch55930/fix_sprintf_compile_err branch from 2522615 to 569c287 Compare June 3, 2020 20:06
Copy link
Member

@technobly technobly left a comment

Choose a reason for hiding this comment

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

As discussed, on-device tests should be updated and run: https://github.com/particle-iot/device-os/tree/develop/user/tests/app/band_select

@keeramis keeramis requested a review from technobly June 3, 2020 20:25
@keeramis
Copy link
Contributor Author

keeramis commented Jun 3, 2020

@technobly Fixed on-device tests 👍

@keeramis keeramis merged commit e8d39df into develop Jun 4, 2020
@keeramis keeramis deleted the ch55930/fix_sprintf_compile_err branch June 4, 2020 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal ready to merge PR has been reviewed and tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants