billvaglienti / ProtoGen

Communications protocol generation software
MIT License
30 stars 16 forks source link

Iterator variables added to 'init' and 'verify' functions unnecessarily #72

Closed SchrodingersGat closed 6 years ago

SchrodingersGat commented 6 years ago

Version 2.11.d

Here is an example of some generated code

void initServo_DeltaConfig_t(Servo_DeltaConfig_t* user)
{
    int i = 0;

    // Position error threshold
    user->threshold = 250;

    // Position error timeout
    user->timeout = 20;

    // Position error filtering
    user->filter = 5;

}// initServo_DeltaConfig_t

There are no array variables, so the iterator should not be generated. This causes noisy compiler warnings.

billvaglienti commented 6 years ago

The fault you describe could occur if a packet had an array field (which requires an encode iterator), but that field did not have init or verify data. I've updated protogen to separately track the iterator requirement for init versus verify versus encode. 2.11.f should resolve the warning, let me know if it does.

SchrodingersGat commented 6 years ago

Looks like this has correctly addressed the issue, thanks