This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Rename C files to .c in GCC source
- From: John Marino <gnugcc at marino dot st>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>, DJ Delorie <dj at redhat dot com>
- Cc: Andrew Pinski <pinskia at gmail dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Jonny Grant <jg at jguk dot org>
- Date: Sat, 31 Jan 2015 09:03:00 +0100
- Subject: Re: Rename C files to .c in GCC source
- Authentication-results: sourceware.org; auth=none
- References: <CAGc9EveH8c7WfQPmDEjrCpSOmxabAECGRBC8T8NUiHbSz2QNmw at mail dot gmail dot com> <EE340ECC-F8A5-49B5-9C83-CD616BC1DDAF at gmail dot com> <xnlhkkx80o dot fsf at greed dot delorie dot com> <CAH6eHdTkWCa4vK=HVVaJaa1dihs4gdjX+u87Q_GO358752Tjkw at mail dot gmail dot com>
On 1/31/2015 02:55, Jonathan Wakely wrote:
> On 30 January 2015 at 21:39, DJ Delorie wrote:
>>
>> pinskia@gmail.com writes:
>>> No because they are c++ code so capital C is correct.
>>
>> However, we should avoid relying on case-sensitive file systems
>> (Windows) and use .cc or .cxx for C++ files ("+" is not a valid file
>> name character on Windows, so we can't use .c++).
>
> These files are only compiled by GCC's own build system, with GCC's
> own makefiles, so we know we invoke the C++ compiler and so the
> language isn't inferred from the file extension, and so we aren't
> relying on case-sensitive file systems.
To give a counter-perspective, having files that need to be compiled
with c++ driver having the extension ".c" gives external build systems
fits. Case in point, I'm working on bringing gcc5 into DragonFly as a
next base compiler and the make's base scripts all immediately use the c
driver for c files -- I had to apply hacks everywhere and even create
new local equivalents of "bsd.*.mk" files in some cases. (vendor
makefiles are never used by policy, new "bmake" ones have to be created
and imported -- this seems to be common to all BSD)
Even if this issue is normally hidden due to gcc's makefiles accounting
for it, having misleading file names can only cause problems. I'll
add a "+1" to the suggestion to go rename everything consistently and
accurately.
Sorry about butting in, but I thought that my recent experience with
this might be relevant to the topic.
John