On 22 February 2011 08:27, JussiP <email address hidden> wrote:
> Constifying is a very good thing, and something I would very much like
> to see done.
>
> A question for people who have knowledge in C ABI: is it possible to
> have something like these:
>
> void func(someStruct *foo)
> void func(const someStruct *foo)
>
> in the same dynamic library without clashes?
>
You can't have same function exported twice with different signature in C.
And change from one to another breaks API.
You can version your symbols (provide a symbols file) and add a new
function e.g.
void func_ng(const someStruct *foo)
marked for the new api version (NB! no soname api/abi bump)
That way old binaries will still work with a new library. And new
software can use the new function.
> If yes, then the change can be made without breaking ABI by adding the
> const function and making the non-const call the const one.
>
> --
> You received this bug notification because you are a member of Cuneiform
> Linux, which is the registrant for Cuneiform for Linux.
> https://bugs.launchpad.net/bugs/720782
>
> Title:
> Passing DIB image as const void *
>
On 22 February 2011 08:27, JussiP <email address hidden> wrote:
> Constifying is a very good thing, and something I would very much like
> to see done.
>
> A question for people who have knowledge in C ABI: is it possible to
> have something like these:
>
> void func(someStruct *foo)
> void func(const someStruct *foo)
>
> in the same dynamic library without clashes?
>
You can't have same function exported twice with different signature in C.
And change from one to another breaks API.
You can version your symbols (provide a symbols file) and add a new
function e.g.
void func_ng(const someStruct *foo)
marked for the new api version (NB! no soname api/abi bump)
That way old binaries will still work with a new library. And new
software can use the new function.
> If yes, then the change can be made without breaking ABI by adding the /bugs.launchpad .net/bugs/ 720782
> const function and making the non-const call the const one.
>
> --
> You received this bug notification because you are a member of Cuneiform
> Linux, which is the registrant for Cuneiform for Linux.
> https:/
>
> Title:
> Passing DIB image as const void *
>