[LyX/master] Fix Clang warning about struct/class mismatch

Scott Kostyshak skostysh at lyx.org
Thu Nov 26 21:39:16 UTC 2020


On Thu, Nov 26, 2020 at 08:06:38PM +0100, Jean-Marc Lasgouttes wrote:
> Le 26/11/2020 à 19:21, Scott Kostyshak a écrit :
> > commit 9649e80c44f501d3ec758343c2eb0fd53a47d10f
> > Author: Scott Kostyshak <skostysh at lyx.org>
> > Date:   Thu Nov 26 13:48:42 2020 -0500
> > 
> >      Fix Clang warning about struct/class mismatch
> >      CaretGeometry is defined as a struct, but was forward-declared as a
> >      class. Now we forward-declare as a struct. This addresses the
> >      following Clang warning (that does not appear with GCC):
> 
> Good catch.

Actually I realize I am ignorant on this: why is it preferred to use a
forward declaration here? i.e., why not the following:

#include "frontends/CaretGeometry.h"

Is it because of faster compilation time or because we don't want to
include a file from frontends/? Or is it for readability because when I
see a forward declaration it gives me information that knowing the
definition is not important for whatever purpose we use it for in this
file?

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20201126/8b8f8e0e/attachment.asc>


More information about the lyx-devel mailing list