This doesn't make any sense, the point of including headers is so that definitions are available to compilers for checking and optimisations. By making them opaque pointers that is defeated.

I disagree. If items inside struct GeanyBuildCommand are private and shall only be used inside build.c then it is practicable to use a forward declaration and hide the struct items. No code outside build.c can then use the struct in a wrong way. Of course this requires functions to access/use all aspects of struct GeanyBuildCommand. As the struct GeanyFiletypePrivate only uses pointers to struct GeanyBuildCommand the compiler has all information it needs and can still do type checks etc. (it is still a struct GeanyBuildCommand * not a void *). If something was missing then there would be a compiler error. But I would prefer a forward declaration with typedef.

As long as the items of struct GeanyBuildCommand shall only be used in build.c and if it shall stay like that in the future then I actually consider this good style.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.