Skip to content

Clean up examples to remove warnings [imported] #693

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
cmaglie opened this issue Nov 15, 2012 · 1 comment
Closed

Clean up examples to remove warnings [imported] #693

cmaglie opened this issue Nov 15, 2012 · 1 comment
Assignees

Comments

@cmaglie
Copy link
Member

cmaglie commented Nov 15, 2012

This is Issue 693 moved from a Google Code project.
Added by 2011-10-24T01:49:13.000Z by maniac...@ymail.com.
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Defect, Priority-Medium, Component-Examples

Original description

Some examples have warnings which indicate where a few clean-ups could be made. This patch fixes all those.

(If it doesn't apply cleanly let me know, I'll regenerate one from a clean repo)

@per1234
Copy link
Collaborator

per1234 commented Jul 2, 2017

Done:

  • BlinkWithoutDelay.ino: 83ef181
  • Arrays.ino: a6022df
  • StringIndexOf.ino: 47bcf07
  • StringToIntRGB.ino: This file is no longer part of the bundled examples.

WontFix:

  • StringLength.ino: I think this change is not desirable because it introduces a type (size_t) that the target audience of the bundled examples will not be familiar with.
 String txtMsg = "";                         // a string for incoming text
-int lastStringLength = txtMsg.length();     // previous length of the String
+size_t lastStringLength = txtMsg.length();     // previous length of the String

and the return type of length() is unsigned int (https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/WString.h#L81). However, the warning should be fixed and I have submitted a PR for this: #6449

To Do

cmaglie pushed a commit that referenced this issue Jul 6, 2017
- Avoids confusing beginners who assume there must be some reason for this useless line of code.
- Fixes "warning: unused variable 'currentTime'" compiler warning.

Closes #693
cmaglie pushed a commit that referenced this issue Jul 6, 2017
…ample

Fixes:
warning: comparison between signed and unsigned integer expressions
compiler warning.

Closes #693 (in conjunction with #6448)
s0ren pushed a commit to STU-IT/arduino17-18 that referenced this issue Dec 6, 2017
- Avoids confusing beginners who assume there must be some reason for this useless line of code.
- Fixes "warning: unused variable 'currentTime'" compiler warning.

Closes arduino/Arduino#693
s0ren pushed a commit to STU-IT/arduino17-18 that referenced this issue Dec 6, 2017
…ample

Fixes:
warning: comparison between signed and unsigned integer expressions
compiler warning.

Closes arduino/Arduino#693 (in conjunction with arduino/Arduino#6448)
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

4 participants