Skip to content

Conversation

@pabigot
Copy link
Contributor

@pabigot pabigot commented Aug 14, 2019

Consistently place C++ use of extern "C" after all include directives,
within the negative branch of _ASMLANGUAGE if used.

Remove extern "C" support from files that don't declare objects or
functions.

Background from issue #17997:

Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.

Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.

See: https://en.cppreference.com/w/cpp/language/language_linkage
Signed-off-by: Peter Bigot [email protected]

@pabigot pabigot added area: RISCV RISCV Architecture (32-bit & 64-bit) area: C++ labels Aug 14, 2019
@pabigot pabigot added this to the v2.0.0 milestone Aug 14, 2019
@pabigot
Copy link
Contributor Author

pabigot commented Aug 14, 2019

Expect shippable to fail until #18198 is resolved. That is not a regression due to the changes in this PR. Actually the RISCV toolchain bug is not triggered by the content of this PR; it shows up in #18243.

Consistently place C++ use of extern "C" after all include directives,
within the negative branch of _ASMLANGUAGE if used.

Remove extern "C" support from files that don't declare objects or
functions.

Background from issue zephyrproject-rtos#17997:

Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.

Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.

See: https://en.cppreference.com/w/cpp/language/language_linkage
Signed-off-by: Peter Bigot <[email protected]>
@ioannisg ioannisg merged commit 43fc6a7 into zephyrproject-rtos:master Aug 18, 2019
@pabigot pabigot deleted the exc/riscv branch August 18, 2019 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: API Changes to public APIs area: C++ area: RISCV RISCV Architecture (32-bit & 64-bit)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants