PaulStoffregen / AltSoftSerial

Software emulated serial using hardware timers for improved compatibility
http://www.pjrc.com/teensy/td_libs_AltSoftSerial.html
334 stars 131 forks source link

Elimininate 'unused parameter' warnings #46

Closed bperrybap closed 3 years ago

bperrybap commented 6 years ago

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 commented 3 years ago

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

bperrybap commented 3 years ago

I would suspectattribute 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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Thanks!