KDE_NO_EXPORT

Kuba Ober kuba at mareimbrium.org
Tue Jul 25 15:13:39 BST 2006


On Tuesday 18 July 2006 18:08, Thiago Macieira wrote:
> Allen Winter wrote:
> >The KDE_NO_EXPORT is no more cruft than a comment saying "Please do no
> > make this class visible because it is private and I want to keep it
> > that way..." or using the @internal doxygen tag.
> >
> >We need some method to tag a public class as "invisible".
> >Then we don't have bug the developers asking... are the following
> >classes supposed to be invisible outside the library or did you just
> >forget to put on the XXXX_EXPORT macro?
> >
> >We can do that with a comment, a doxygen tag, or the KDE_NO_EXPORT
> > macro. Which would we prefer?
>
> If you put it in the code instead of in the comment, there's a chance that
> some source code parser will freak out.
>
> Granted, there aren't many.
>
> But the point is: there is no problem here to be solved unless we create
> the problem by requiring the KDE_NO_EXPORT macro to be used. There's no
> harm in forgetting the macro in a class: no one is going to be able to
> use it. That's all.

I guess that Allen's idea was to make things less redundant. If a class etc. 
is marked as private in the doxygen comments etc., then maybe it'd be simpler 
to have a macro similar to the one used to mark the class as public. I.e. it 
makes it harder to remember that public classes have KDE_NO_EXPORT, and 
private ones need a special comment somewhere. To make it clear, either they 
should all use macros, or all use comments, not both. Or only have the public 
ones use a macro, and the private ones would be fine without anything special 
(no macros, no special comments).

I guess if we want to go the "macro only for exported classes" route, then the 
doc generators need to be configured to assume that anything that's not 
exported is private, without any special comments to that effect. They should 
obviously recognize the KDE_EXPORT macro as well, and not need special 
comments for public classes either.

If KDE_NO_EXPORT macro should not be used, then it would make sense to have it 
removed from all places where it's currently present, including the #define.

Does that sound sane?

Cheers, Kuba




More information about the kde-core-devel mailing list