Skip to content

Remove compiler warning for typedef'ed generic compare function and its specific implementation #2

@devprabal

Description

@devprabal

Branch: https://github.com/devprabal/small-linklist/tree/develop

main.c:69:26: warning: initialization of ‘_Bool (*)(void *, void *)’ from incompatible pointer type ‘_Bool (*)(Person *, Person *)’ [-Wincompatible-pointer-types]
   69 |     [ITEM_TYPE_PERSON] = compare_person,
      |                          ^~~~~~~~~~~~~~
main.c:69:26: note: (near initialization for ‘compare_item_func_list[0]’)

However, you should neither change find_in_list() nor compare_person().
You can create new data structure and/or functions, and change other implementations, if you want.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions