www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - File extension of c++ files used on d compiler sources

reply "Domingo Alvarez Duarte" <mingodad gmail.com> writes:
Hello !

I'm starting to look at the d compiler sources and I'm using 
netbeans to navigate through the sources, netbeans is very good 
at showing warnings/errors with it's own internal parser, but 
because all the c++ source files use ".c" as file extension they 
are interpreted as "C" files and shows a lot of errors parsing 
then as "C" files.

It could be a silly question but here it is:

Why the c++ source files do not use file extensions that proper 
identifies then as c++ like ".cpp", ".C", ".cxx" ?

This prevent/difficult some task automations by third party tools 
like I'm experimenting now with netbeans.

It's fine that D is innovating in the programming language field 
but not all conventions are bad ones.

Cheers !
Jul 14 2014
next sibling parent reply "Jesse Phillips" <Jesse.K.Phillips+D gmail.com> writes:
On Monday, 14 July 2014 at 23:14:52 UTC, Domingo Alvarez Duarte 
wrote:
 It's fine that D is innovating in the programming language 
 field but not all conventions are bad ones.

 Cheers !
Legacy, pretty sure the early C++ days used .c and Walters compiler comes from those early days. I believe it hasn't change because of cost/benefit.
Jul 14 2014
next sibling parent reply "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
On Tue, Jul 15, 2014 at 02:16:36AM +0000, Jesse Phillips via Digitalmars-d
wrote:
 On Monday, 14 July 2014 at 23:14:52 UTC, Domingo Alvarez Duarte wrote:
It's fine that D is innovating in the programming language field but
not all conventions are bad ones.

Cheers !
Legacy, pretty sure the early C++ days used .c and Walters compiler comes from those early days. I believe it hasn't change because of cost/benefit.
Not being usable in an IDE is a pretty big cost IMO. (Even though I myself don't even use IDE's!) Maybe you might stand a chance of convincing Walter to do it. Probably after the upcoming release, since right now the focus is to get that out the door first. T -- The most powerful one-line C program: #include "/dev/tty" -- IOCCC
Jul 14 2014
parent Jacob Carlborg <doob me.com> writes:
On 15/07/14 04:21, H. S. Teoh via Digitalmars-d wrote:

 Not being usable in an IDE is a pretty big cost IMO. (Even though I
 myself don't even use IDE's!) Maybe you might stand a chance of
 convincing Walter to do it. Probably after the upcoming release, since
 right now the focus is to get that out the door first.
The front end will be translated to D anyway. Then it's only the backend. -- /Jacob Carlborg
Jul 15 2014
prev sibling parent "Paulo Pinto" <pjmlp progtools.org> writes:
On Tuesday, 15 July 2014 at 02:16:37 UTC, Jesse Phillips wrote:
 On Monday, 14 July 2014 at 23:14:52 UTC, Domingo Alvarez Duarte 
 wrote:
 It's fine that D is innovating in the programming language 
 field but not all conventions are bad ones.

 Cheers !
Legacy, pretty sure the early C++ days used .c and Walters compiler comes from those early days. I believe it hasn't change because of cost/benefit.
Yep, compilers even had flags to state how to interpret .c files. -- Paulo
Jul 15 2014
prev sibling next sibling parent Jacob Carlborg <doob me.com> writes:
On 15/07/14 01:14, Domingo Alvarez Duarte wrote:
 Hello !

 I'm starting to look at the d compiler sources and I'm using netbeans to
 navigate through the sources, netbeans is very good at showing
 warnings/errors with it's own internal parser, but because all the c++
 source files use ".c" as file extension they are interpreted as "C"
 files and shows a lot of errors parsing then as "C" files.
Can't you manually specify the language of the files? I've done that in Xcode, it's only necessary to do once per file. -- /Jacob Carlborg
Jul 15 2014
prev sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Monday, 14 July 2014 at 23:14:52 UTC, Domingo Alvarez Duarte 
wrote:
 Hello !

 I'm starting to look at the d compiler sources and I'm using 
 netbeans to navigate through the sources, netbeans is very good 
 at showing warnings/errors with it's own internal parser, but 
 because all the c++ source files use ".c" as file extension 
 they are interpreted as "C" files and shows a lot of errors 
 parsing then as "C" files.

 It could be a silly question but here it is:

 Why the c++ source files do not use file extensions that proper 
 identifies then as c++ like ".cpp", ".C", ".cxx" ?

 This prevent/difficult some task automations by third party 
 tools like I'm experimenting now with netbeans.

 It's fine that D is innovating in the programming language 
 field but not all conventions are bad ones.

 Cheers !
I've had problems with using third party tools on the dmd source as well. Renaming files in git is non-destructive and easy.
Jul 15 2014