Author Topic: The 10 May 2007 build will NOT be out. (developers please read this)  (Read 12531 times)

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: The 10 May 2007 build will NOT be out. (developers please read this)
« Reply #15 on: May 15, 2007, 10:07:06 am »
sounds nice but ...... I had a look at the envvars.h, you added cbproject.h to the include list. Why ?
I don't see any reason why, or maybe it's still to early in the morning for me ;-)


In case it would be for FileTreeData : you should use the forward declaration :
class FileTreeData;

Yup, cbproject.h is included because of FileTreeData. Plugin adds it because this structure is used somewhere in code. Now the only function where it's used is:

Code: [Select]
  void    BuildModuleMenu(const ModuleType type, wxMenu* menu,
                          const FileTreeData* data = 0)
  { return; }

Without expensive parsing there's no way to detect whether we access members of structure in source or not. And if we use members of structure, the structure has to be fully defined. cbproject.h is added "just in case".

Plugin works on very low level - it only does basic tokenization of sources and take list of used identifiers (no matter what context it is, whether it's class member or type name etc) so it can blindly add some headers, like the one mentioned before, "just in case". In some situations it's not advised (f.ex. when forward declaration is required to compile properly), so I don't advise using this plugin on C::B sdk project because it may even break the build. But it's output may be used as a hint when some plugins can not compile because of missing headers. One more sdk header in plugin's source won't break the build but may be usefull when sources need to be compiled quickly without investigating what headers are missing.

And one more thing - when C::B will have some really accurate c++ parser and refactoring tool, this tool would probably do this job much better. So I don't plan to upgrade my plugin and I would preffer not putting it into svn since it may cause more problems than benefits for unexperienced users. Just threat it as temporary solution ;)

BYO

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: The 10 May 2007 build will NOT be out. (developers please read this)
« Reply #16 on: May 15, 2007, 01:10:14 pm »
More on Header-Fixup plugin in this thread.

BYO