[Syslinux-patches] HDT merge

Pierre-Alexandre Meyer pierre at mouraf.org
Wed Aug 5 21:19:21 PDT 2009

On Wed, Aug 05, 2009 at 06:50:18AM +0200, Pierre-Alexandre Meyer wrote:
>   * callback should be typedef (always thought typedefs were 3vi7?)

We talked about it with AndyTim and hpa on IRC. Two main reasons to use
typedefs for function pointers:

  * readability
  * maintainability (if the interface needs to be changed)

Besides, it adds a safety net on compilation. gcc throws a warning if the
function you defined doesn't match the typedef:

  warning: initialization from incompatible pointer type

(I would love to fix the signedness issues in the build and turn on

By the way, hpa found a nice bug in the lib: we had

       void *callback(struct driveinfo *, struct part_entry *, int, int)

where we should have had

       void (*callback)(struct driveinfo *, struct part_entry *, int, int)

Productive evening!

Pierre-Alexandre Meyer

More information about the Syslinux-patches mailing list