Re: [PATCH v2 3/9] kernel-shark: Fix KS_DEFINE_PLUGIN_CONTEXT macro

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

 





On 10.05.21 г. 21:25, Steven Rostedt wrote:
On Mon, 10 May 2021 14:53:08 +0300
Yordan Karadzhov <y.karadz@xxxxxxxxx> wrote:

Can you show me how you see this error, because this solution does not make
any sense.

The problem is that some plugins can build from multiple source files.
For example in the case when part of the plugin is written in C and
another part in C++. In those cases we cannot have the functions being
static.

So it's because its a mixture of C and C++ code? And you can't make them
static?

No, this has no direct connection with C++. The static functions are the same in C++. It became an issue if you have multiple source files. If this is the case you have to put the macro in a header file, so that you can use the functions defined in the macro in all your source files. But this does not work, because the macro defines some global variables as well. To solve this I defined second macro to be used only in the header, but then the functions can't be static.

Thanks!
Yordan


So this isn't a name resolution issue, it's a C to C++ issue where static
doesn't work? If that is the case then the change log is misleading.

-- Steve




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

  Powered by Linux