luxonis / XLink

A cross-platform library for communicating with devices over various physical links.
Apache License 2.0
12 stars 18 forks source link

assert test in `pcie_host` are always true; suggests logic or coding bug earlier #66

Open diablodale opened 1 year ago

diablodale commented 1 year ago

Found by compiler warnings. These asserts are always true and therefore useless asserts. This suggests a logic failure before, wrong variable types, coding error, etc.

https://github.com/luxonis/XLink/blob/d209b7eeb8ac68435df5097e57e1dfd8ea1d0e83/src/pc/protocols/pcie_host.c#L148

https://github.com/luxonis/XLink/blob/d209b7eeb8ac68435df5097e57e1dfd8ea1d0e83/src/pc/protocols/pcie_host.c#L224

They are always true because their param is an unsigned variable, therefore it is be definition always >=0 making these asserts always true.