Skip to content

Value declaring in threadbank.h #3

@markkuleppala

Description

@markkuleppala

Usually you want to declare a variable in only one place, preferably in a
code module. Then put an "extern" variable declaration in a header. That
way variable is allocated only once and connected together in linking stage.
If you have plain "int i;" in a header file, each source code module that
includes that header, will initialize a global variable with name i. This
can fail in compile time for multiple copies of symbol i.

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