jfjlaros / simpleRPC

Simple RPC implementation for Arduino.
MIT License
50 stars 17 forks source link

Fix un-initialized usage of data. #28

Closed slaff closed 2 years ago

slaff commented 2 years ago

Example error output before this PR.

signature.tcc:60:12: error: ‘data’ is used uninitialized in this function [-Werror=uninitialized]
   60 |   rpcTypeOf(io, data);

Tested with GCC version 9.4.0 on Ubuntu.

jfjlaros commented 2 years ago

Just for clarification.

These variables are only declared to pass on to the rpcTypeOf() function for type deduction, their values are never used. All code containing these variables are optimised away by the compiler (perhaps unless the compiler can be instructed not to do so).

So, is it correct to say that this patch is only for getting rid of compiler warning messages?

slaff commented 2 years ago

So, is it correct to say that this patch is only for getting rid of compiler warning messages?

Yes, correct.

jfjlaros commented 2 years ago

Okay, thank you for the patch.