[Geany-devel] C/C++ Header filetypes (Re: Committed Project Build Commands to build-system branch)
nick.treleaven at xxxxx
Tue Nov 11 12:46:49 UTC 2008
On Tue, 11 Nov 2008 14:26:39 +1100
"Lex Trotman" <elextr at gmail.com> wrote:
> C++ headers are potentially much more complex than C ones with
> templates and inline functions in them. So not having language
> support is significant. The C++ application I am working on (and
C++ headers are not a separate language from C++ source files, they
are the same language. Same for C headers.
> The point of all this is that providing support for the C++ .h files
> is important, so correctly detecting them is important. So is
Agreed, the first line detection would be a good feature.
> Having separate C++ header templates with the mark already in it
> would help users to remember to add it. BTW it would be good to have
I don't think we should encourage people to make C++ header files with
a .h extension, they should use an extension unique to C++.
BTW with custom file templates you can have as many templates as you
like for the same filetype, so you could have header.hpp, source.cpp,
etc template files.
> In terms of using make object, the .h doesn't compile to a .o file so
> thats no good, and I have to admit I don't quite see how make could
I meant when you have a foo.h file and a foo.c file, you can use Make
Object on the foo.h file.
When you only have a foo.h file, this is where having custom filetype
commands would be helpful - either a command to compile the header or a
syntax check command. (This could also be a project command).
> I can understand your concern about flow on effects with other
> languages, unfortunately I don't know enough of them to contribute to
There could be special files for some languages that require different
build commands, but if they are the same language they should not have
a separate filetype. This is a build command issue, not a filetype one.
> In summary my judgement is that C++ users (me, I'm not claiming to be
> unbiased) would gain significantly by having proper header file
> support and C users much less. And I don't see that either user
> community loses anything.
This would cause more code to maintain, and more checks for header
filetypes as well as the source file filetypes.
More information about the Devel