Re:C23 is finished: Here is what is on the menu
by zozbot234 on Friday August 05, 2022 @06:02AM
(#32353922)
> how do you do when you want to access your C function from a language which is binary-compatible with C but uses :: for something else?
Typically you'd do this by picking a different internal name for the function, and putting the external symbol in quotes.
Re:C23 is finished: Here is what is on the menu
by jstimpfle on Friday August 05, 2022 @06:10AM
(#32353984)
Fair point. The C naming convention with flat names is quite conservative and consequently allows the names to be used directly from most other languages without any language-aware mapping / compatibility layer.
how do you do when you want to access your C function from a language which is binary-compatible with C but uses :: for something else? [a-zA-Z_][a-zA-Z0-9_]* identifiers are the only thing that the whole world more-or-less standardized around.
e.g. in fortran you can directly import a C function and call it. But "::" in the middle of a function name would very likely fail (I don't know enough fortran to tell for sure but given how the syntax looks...):
allows to call a "void foo(double *a, int n);" function defined in C. I imagine that would likely not work