-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the behavior if the program invokes an external entity #425
Comments
(I'm not introducing new worlds of documentation requirements for implementations in a core issue. If you want that, please write a paper. Some things are not specified by the C++ standard (e.g. name mangling and calling conventions), and the absence of such is not a defect, but an intentional limitation of scope.) Note that the name mangling is not specified in the C++ standard, so it's not specified whether the _fun defined in impl.S would actually link against the 'extern "C"' fun you're referring to in C++. (For example, on my Linux box, I get "undefined reference to `fun'" when trying to compile your example.) |
@jensmaurer but since it is about linkage, I think [dcl.link]/10 should say «entities» instead of «objects». Looks editorial enough? |
This is exactly the domain of implementation-defined behavior. So, I think the [dcl.link] should also say the linage for functions is also implementation-defined. |
Changing [dcl.link] p10 doesn't quite fit, because the second sentence specifically explains why sharing objects between language might be hard. (In contrast, calling a foreign-language function with scalar parameters is probably much easier to make work.) |
The case with |
|
Full name of submitter (unless configured in github; will be published with the issue): Jim X
Since [lex.phases] p1.9 says:
and [dcl.link] says we can link to that entity. Consider this case:
What's the behavior at
#1
? Is it implementation-defined or unspecified behavior, or just UB? Because this is a well-formed program, according to [intro.abstract] p5, it must have some observable behaviors. However, the current standard says nothing in this case.Suggested Resolution
[dcl.link] p10 may be changed to cover this case
Then, the implementation should be responsible for telling the complete story.
The text was updated successfully, but these errors were encountered: