So, let's say I have a C library exposing a function "void foo(int *array)". And now I realize that I should have added a "const" to the "int*", since the array is input and never modified by the func, and that should be in the contract. I figure in C changing this is not a…
-
-
Isn't the point of using extern "C" to use C non-mangling symbol names for the corresponding declarations? I rarely dabble in C++ so my memory is rusty. Perhaps a quick experiment to see what symbol names are with a few compilers?
-
Well, the q is about more than just symbol mangling ultimately. is this an OK change to do without declaring this a compat breakage in general? i.e. would the C++ func prototype compat checker complain about this in some condition? or do the same thing with and without the const?
- Još 1 odgovor
Novi razgovor -
-
-
I've learned that once you ship a change like that, the whole internet will know the correct answer...
- Još 1 odgovor
Novi razgovor -
-
-
This change is safe for C++, if you extern C the declaration. The parameters are not mangled into the name.
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
It's not a breakage in a practical sense. C does not mangle, so language X can still link without issues (as before). What you break is formal ABI checking - some projects might check their deps for ABI changes in a CI for example... But possibly not a big deal !?
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.