I'm a C++ programmer who only uses C to modify Geany ;-).<br><br>Nevertheless I have to agree with Enrico that if Geany cannot tell that a .h file is C++ it should default to C.  Much of the open source software is still C so it has precedence and volume on its side.  In general it is not possible to tell if a header is C or C++, even for the compiler, which is why extern C {} is there.  There has been past discussion in this ML of looking for VIM and Emacs file marks in the first line but these are not universal either.<br>

<br>It is unfortunate that C++ originally used .h for files that are not backward compatible and that the main reference on C++ (Stroustrup) still touts .h for C++ headers.  New C++ should use .hpp, so that tools and humans can easily tell that this header is not C.  Then if you include a .h in your C++ (for a library or such) then you know to wrap that header in extern C constructs.  <br>

<br>But of course there is already much existing C++ software out there that uses .h.  If you can't change the extension or use some other way of marking it, then I'm afraid that the only solution is going to be manually choosing the filetype or changing your personal default.<br>

<br>I don't think that it would affect the build-system per se, but the default command will of course change with the filetype, so C headers would default to the C++ compiler command.  That shouldn't do any damage but might not be helpful to users.<br>
<br>Cheers<br>Lex<br><br><div class="gmail_quote">2009/7/9 Enrico Tröger <span dir="ltr"><<a href="mailto:enrico.troeger@uvena.de" target="_blank">enrico.troeger@uvena.de</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div>On Wed, 8 Jul 2009 16:46:59 +0200 (MEST), Yves wrote:<br>
<br>
><br>
>----- original message --------<br>
><br>
>Subject: Re: [Geany-devel] C++ file-type extensions<br>
>Sent: Wed, 08 Jul 2009<br>
>From: Frank Lanitz<<a href="mailto:frank@frank.uvena.de" target="_blank">frank@frank.uvena.de</a>><br>
><br>
>> Am Mittwoch, den 08.07.2009, 15:18 +0200 schrieb Yves Pausch:<br>
>><br>
>> > As I have problems attaching the patch I provide a link instead:<br>
>> > <a href="http://www.ype.de/files/geany_cpp.patch" target="_blank">http://www.ype.de/files/geany_cpp.patch</a><br>
>><br>
>> At least for .h file this would introduce wrong behaviour as header<br>
>> for C++ should be either .H or .hpp. Nevertheless this is something<br>
>> you can configure on your end. Just have a look onto<br>
>> <a href="http://www.geany.org/manual/current/index.html#filetype-extensions" target="_blank">http://www.geany.org/manual/current/index.html#filetype-extensions</a><br>
>><br>
>> Cheers,<br>
>> Frank<br>
><br>
>--- original message end ----<br>
><br>
>The new behaviour wouldn't imho be wrong only different from the<br>
>existing. I don't see any drawbacks while handling C headers in the<br>
>same way as C++ headers apart from it isn't completely precise. Most<br>
>of the C++ projects that I know or I'm involved into name their<br>
>headers *.h and commonly only template class declarations will be put<br>
>into *.hpp there. Bye, Yves.<br>
<br>
</div>And what about the other tousands of C projects around? They loose<br>
syntax support for their headers files by default.<br>
<br>
Really, changing *.h from C to C++ is a no go. You already know how you<br>
can handle that for your own configuration. We won't change that in<br>
Geany. So, I agree fully with Frank and Colomban.<br>
<br>
<br>
Not sure about *.ipp, never heard of it.<br>
<br>
Regards,<br>
Enrico<br>
<font color="#888888"><br>
--<br>
Get my GPG key from <a href="http://www.uvena.de/pub.asc" target="_blank">http://www.uvena.de/pub.asc</a><br>
</font><br>_______________________________________________<br>
Geany-devel mailing list<br>
<a href="mailto:Geany-devel@uvena.de" target="_blank">Geany-devel@uvena.de</a><br>
<a href="http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel" target="_blank">http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel</a><br>
<br></blockquote></div><br>