Skip to content

Remove '#ifdef __cplusplus extern "C"' sections from C sources #226

@saxbophone

Description

@saxbophone

Chunks of code like this:

#ifdef __cplusplus
extern "C"{
#endif

are useful in C header files in allowing C++ programs to use C functions, by specifying those functions with C linkage.

However, although this is tolerable when it comes to headers, it shouldn't be used in source files. My source files aren't written with the intention of the code in them being 100% compatible with C++, so I should not put anyone under any illusion that they can be compiled with a C++ compiler (even if that might work).

TL; DR; Make it clear that the library intends to be used by C++ programs, but that the library itself should still be compiled as C.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions