Re: tep_free_plugin_paths() function in libtraceevent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2020-09-15 at 16:12 +0300, Tzvetomir Stoyanov wrote:
> On Tue, Sep 15, 2020 at 12:29 AM Arnaldo Carvalho de Melo
> <arnaldo.melo@xxxxxxxxx> wrote:
> > Em Fri, Sep 11, 2020 at 03:08:16AM +0100, Ben Hutchings escreveu:
> > > I noticed that the new function tep_free_plugin_paths() is exported
> > > from libtraceevent, but is only declared in a private header file.
> 
> Hi Ben,
> The tep_free_plugin_paths() function is supposed to be an internal
> function, not an API - that's why it is in a private header. What do you
> mean by "exported": the "tep_" prefix, or the fact that it is not static?

It is exported from the shared library, i.e. it's included in the
library's dynamic symbols.  That means that it could be called by a
program using the library, and would conflict with a function defined
by the program.

> I can remove the prefix, if that is what bothers you.

No, exporting symbols without that prefix would make conflicts more
likely.

> The function is
> defined in event-plugin.c and is used in event-parse.c, that's why it
> cannot be made static without a library redesign.

Yes, I realise that.  However you can define it as "hidden":
<https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Common-Function-Attributes.html#index-visibility-function-attribute>.

Ben.

> > > If it's meant to be part of the API, it should be declared in a public
> > > header file.  If not, I think it should be hidden from library users.
> > > 
> > > (I think there are other only functions with this issue; this just came
> > > to my attention because the Debian packaging tools prompted me to
> > > update the symbol-to-minimum-version mapping.)
> > 
> > Tzvetomir, can you please take a look?
> > 
> > - Arnaldo
> 
> 
-- 
Ben Hutchings
I'm not a reverse psychological virus.
Please don't copy me into your signature.

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux