Topic: Setting calling convention separately from rest of linkage
Author: Jeremiah Willcock <jewillco@crest.iu.edu>
Date: Wed, 16 Oct 2013 14:13:11 -0400 (EDT)
Raw View
There does not appear to currently be a way to have a function with
internal linkage but C calling convention: extern "C" uses external
linkage, while "static" uses the C++ calling convention. The particular
issue where this matters is in passing function pointers to C code. For
example, there is no Standard-allowed way to pass an instance of a
function template as a C function pointer without an extra layer of
non-template wrapping. Would it make sense to have a construct
that sets the calling convention but uses internal
linkage, or a mechanism that only sets the calling convention without
affecting linkage at all (to allow the kind of linkage used for template
instances)? Because it would not affect name mangling, it could be
applied to function templates as well, plus the names of these functions
would not need to be unique across namespaces as with extern "C".
-- Jeremiah Willcock
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.