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

Elimininate 'unused parameter' warnings #46

Closed
bperrybap opened this issue Apr 2, 2018 · 5 comments · Fixed by fourstix/AltSoftSerial#2
Closed

Elimininate 'unused parameter' warnings #46

bperrybap opened this issue Apr 2, 2018 · 5 comments · Fixed by fourstix/AltSoftSerial#2

Comments

@bperrybap
Copy link

Paul,
you can remove the unused parameter warnings in AltSoftSerial.h by doing this:
line 63:

AltSoftSerial(uint8_t rxPin, uint8_t txPin, bool inverse = false) { (void) rxPin; (void) txPin; (void) inverse;}

line 68

static void enable_timer0(bool enable) { (void) enable;}
@JM-FRANCE
Copy link

it's probably better to add __attribute__ ((unused)) in front of all the infringing parameters

@bperrybap
Copy link
Author

I would suspect__attribute__ won't be as portable given it isn't part of the actual standard and is primarily a gcc thing.
While Arduino and 3rd party developers currently seem to all be using gcc for their platform toolsets, it might potentially be an issue at some point.

@JM-FRANCE
Copy link

JM-FRANCE commented Feb 25, 2021

fair enough
I had arduino in mind and I edited my own version of the library to add those. works fine but indeed a GCC thingy

@bperrybap
Copy link
Author

I think that given Arduino and its 3rd party platforms have used gcc from the beginning for well over 10 years now, that there are probably many little gcc things scattered around so it likely is not an issue worth worrying over.
In fact, I've got a few gcc specific things in some of my libraries.

@JM-FRANCE
Copy link

Thanks!

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 a pull request may close this issue.

2 participants