panda icon indicating copy to clipboard operation
panda copied to clipboard

Delete utils.c and can.h from panda

Open aubsw opened this issue 8 months ago • 0 comments

  • Must be merged after https://github.com/commaai/opendbc/pull/2076
  • This PR deletes duplicated code from opendbc.
  • Compile safety.o object file to link definitions that panda needs from opendbc at compile time without duplicated function definitions (we need this to progress on https://github.com/commaai/panda/issues/2171)

details

utils.h and can.h are approximately duplicated from opendbc, which is making https://github.com/commaai/panda/issues/2171 hard to land. Why? A couple reasons:

  1. Divergence
  • Over time, both of these headers have diverged slightly. For example, there are functions declared as static in one, but not the other. This results in issue at compile time. Instead of having worry about the divergences, let's just have one consistent picture of the world.
  1. Function implementations in header
  • Since opendbc has not yet adopted source/header style, we can't include many headers from opendbc in panda without getting multiple defintions of the same symbols (compilation errors).

aubsw avatar Apr 11 '25 19:04 aubsw