Skip to content

C library hygiene: Use symbol prefixes as a namespace mechanism to mitigate the risk of clashes #2

@amboar

Description

@amboar

libpldm exposes many encode, decode and utility functions as part of its API, but none of them are prefixed to prevent symbol clashes in applications that link against more libraries than just libpldm. For instance, some utility symbols exported by the library include crc8(), crc32() and others.

This violates the best practices suggestion from Good Practices in Library Design, Implementation, and Maintenance:

For every library prepend a chosen prefix to every interface, variable, functions, data structures, a library provides. The prefix need not necessarily be the same for all objects, a library can use more than one prefix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions