Skip to content

Destructors msg_fddata_release and str_release being called via void (*)(void *) is an undefined behaviour. #6

@shamefulCake1

Description

@shamefulCake1

As far as I understand, calling a function via incompatible function pointers (even if the argument types are compatible) is undefined behaviour.

A related (but for c++) question discussed here: https://stackoverflow.com/questions/43220926/call-to-function-unknown-through-pointer-to-incorrect-function-type

Would it be possible to fix this somehow?

libslack/msg.c:357:4: runtime error: call to function msg_fddata_release through pointer to incorrect function type 'void (*)(void *)'
~/repos/daemon/libslack/msg.c:514: note: msg_fddata_release defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libslack/msg.c:357:4 
libslack/list.c:340:4: runtime error: call to function str_release through pointer to incorrect function type 'void (*)(void *)'
~/repos/daemon/libslack/str.c:874: note: str_release defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libslack/list.c:340:4 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions