[Github-comments] [geany/geany] filetypesprivate.h: Don't include build.h (#2299)

Nick Treleaven notifications at xxxxx
Sat Sep 14 09:53:30 UTC 2019


>  the opposite since it forces you to do forward declaration

How is that a negative vs including an entire header that is not needed?

> if the file uses a symbol defined in a header, it should include it. Manually introducing forward declarations should IMO be left to breaking circular dependencies alone.

The point of including headers explicitly per-file is to reduce dependencies on source files. Otherwise we would have geany.h include all headers itself.

We already use forward struct declarations in many headers, most of them are not private structs:

```
$ grep -E 'struct \w+;' src/*.h
src/editor.h:37:struct GeanyDocument;
src/filetypes.h:38:struct GeanyDocument;
src/geanyentryaction.h:42:struct _GeanyEntryActionPrivate;
src/geanymenubuttonaction.h:42:struct _GeanyMenubuttonActionPrivate;
src/keyfile.h:36:struct StashGroup;
src/pluginutils.h:34:struct GeanyPlugin;
src/pluginutils.h:35:struct GeanyDocument;
src/search.h:87:struct GeanyDocument; /* document.h includes this header */
src/search.h:88:struct _ScintillaObject;
src/search.h:89:struct Sci_TextToFind;
src/templates.h:57:struct filetype;
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2299#issuecomment-531466682
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190914/186b38a4/attachment.html>


More information about the Github-comments mailing list