intel / synce4l

GNU General Public License v2.0
22 stars 11 forks source link

Avoid false -Wmaybe-uninitialized warning #31

Closed mlichvar closed 11 months ago

mlichvar commented 12 months ago

This fixes false positives reported by an older gcc:

    In file included from dpll_mon.c:17:
    dpll_mon.c: In function 'dpll_mon_pin_update':
    print.h:54:17: error: 'pin_state' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       54 |                 print(l, x);                            \
          |                 ^~~~~
    dpll_mon.c:334:33: note: 'pin_state' was declared here
      334 |         uint32_t parent_pin_id, pin_state;
          |                                 ^~~~~~~~~
    print.h:54:17: error: 'parent_pin_id' may be used uninitialized in this
    function [-Werror=maybe-uninitialized]
       54 |                 print(l, x);                            \
          |                 ^~~~~
    dpll_mon.c:334:18: note: 'parent_pin_id' was declared here
      334 |         uint32_t parent_pin_id, pin_state;
          |                  ^~~~~~~~~~~~~
mmichaliINTC commented 11 months ago

@mlichvar - would you be so kind to add a "Signed-off-by:" tag to your commit message so I can merge? :)

mlichvar commented 11 months ago

Should be fixed now :).