public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Rename C files to .c in GCC source
@ 2015-01-30 12:23 Jonny Grant
  2015-01-30 17:09 ` pinskia
  0 siblings, 1 reply; 32+ messages in thread
From: Jonny Grant @ 2015-01-30 12:23 UTC (permalink / raw)
  To: gcc

Hello

When I checked out from the trunk I saw that various files had .C
capital extension. Its not a big issue.. but I wondered if they should
be .c like regular source files?

libitm\testsuite\libitm.c++\static_ctor.C
libitm\testsuite\libitm.c++\dropref.C

libitm\testsuite\libitm.c++\eh-1.C
libitm\testsuite\libitm.c++\throwdown.C

I'm not on this list, so could you keep my email address included in
any replies.

Regards, Jonny

-- 
Jonny  jg@jguk.org

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-30 12:23 Rename C files to .c in GCC source Jonny Grant
@ 2015-01-30 17:09 ` pinskia
  2015-01-30 20:30   ` Jonny Grant
  2015-01-30 22:14   ` DJ Delorie
  0 siblings, 2 replies; 32+ messages in thread
From: pinskia @ 2015-01-30 17:09 UTC (permalink / raw)
  To: Jonny Grant; +Cc: gcc





> On Jan 30, 2015, at 4:22 AM, Jonny Grant <jg@jguk.org> wrote:
> 
> Hello
> 
> When I checked out from the trunk I saw that various files had .C
> capital extension. Its not a big issue.. but I wondered if they should
> be .c like regular source files?

No because they are c++ code so capital C is correct. 

Thanks,
Andrew

> 
> libitm\testsuite\libitm.c++\static_ctor.C
> libitm\testsuite\libitm.c++\dropref.C
> 
> libitm\testsuite\libitm.c++\eh-1.C
> libitm\testsuite\libitm.c++\throwdown.C
> 
> I'm not on this list, so could you keep my email address included in
> any replies.
> 
> Regards, Jonny
> 
> -- 
> Jonny  jg@jguk.org

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-30 17:09 ` pinskia
@ 2015-01-30 20:30   ` Jonny Grant
  2015-01-30 22:15     ` Kevin Ingwersen (Ingwie Phoenix)
  2015-01-30 22:14   ` DJ Delorie
  1 sibling, 1 reply; 32+ messages in thread
From: Jonny Grant @ 2015-01-30 20:30 UTC (permalink / raw)
  To: pinskia; +Cc: gcc



On 30/01/15 17:09, pinskia@gmail.com wrote:
>
>
>
>
>> On Jan 30, 2015, at 4:22 AM, Jonny Grant <jg@jguk.org> wrote:
>>
>> Hello
>>
>> When I checked out from the trunk I saw that various files had .C
>> capital extension. Its not a big issue.. but I wondered if they should
>> be .c like regular source files?
>
> No because they are c++ code so capital C is correct.

Ok, I see. Only ever encountered files called .cpp.

Regards, Jonny

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-30 17:09 ` pinskia
  2015-01-30 20:30   ` Jonny Grant
@ 2015-01-30 22:14   ` DJ Delorie
  2015-01-30 22:24     ` Kevin Ingwersen (Ingwie Phoenix)
                       ` (3 more replies)
  1 sibling, 4 replies; 32+ messages in thread
From: DJ Delorie @ 2015-01-30 22:14 UTC (permalink / raw)
  To: pinskia; +Cc: gcc, Jonny Grant


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++).

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-30 20:30   ` Jonny Grant
@ 2015-01-30 22:15     ` Kevin Ingwersen (Ingwie Phoenix)
  0 siblings, 0 replies; 32+ messages in thread
From: Kevin Ingwersen (Ingwie Phoenix) @ 2015-01-30 22:15 UTC (permalink / raw)
  To: Jonny Grant; +Cc: pinskia, gcc


> Am 30.01.2015 um 21:30 schrieb Jonny Grant <jg@jguk.org>:
> 
> 
> 
> On 30/01/15 17:09, pinskia@gmail.com wrote:
>> 
>> 
>> 
>> 
>>> On Jan 30, 2015, at 4:22 AM, Jonny Grant <jg@jguk.org> wrote:
>>> 
>>> Hello
>>> 
>>> When I checked out from the trunk I saw that various files had .C
>>> capital extension. Its not a big issue.. but I wondered if they should
>>> be .c like regular source files?
>> 
>> No because they are c++ code so capital C is correct.
> 
> Ok, I see. Only ever encountered files called .cpp.
> 
> Regards, Jonny

„Valid“ extensions happen to be .cpp, .cxx, .c++, .cc or .C. Although, .C can, in rare occasions, also speak about a pre-processed .c file. But finding this case is like searching a needle in a haystack. :)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-30 22:14   ` DJ Delorie
@ 2015-01-30 22:24     ` Kevin Ingwersen (Ingwie Phoenix)
  2015-01-31  1:57       ` Jonathan Wakely
  2015-02-02 16:23       ` David Malcolm
  2015-01-31  1:55     ` Jonathan Wakely
                       ` (2 subsequent siblings)
  3 siblings, 2 replies; 32+ messages in thread
From: Kevin Ingwersen (Ingwie Phoenix) @ 2015-01-30 22:24 UTC (permalink / raw)
  To: DJ Delorie; +Cc: pinskia, gcc, Jonny Grant


> Am 30.01.2015 um 22:39 schrieb DJ Delorie <dj@redhat.com>:
> 
> 
> 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++).

Apple’s HFS is, on a default OS X install, case insensitive. But .c++ is valid. .cxx sounds pretty straight forward to me, since people also use the $CXX variable.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-30 22:14   ` DJ Delorie
  2015-01-30 22:24     ` Kevin Ingwersen (Ingwie Phoenix)
@ 2015-01-31  1:55     ` Jonathan Wakely
  2015-01-31  8:03       ` John Marino
  2015-02-01 16:09       ` Eli Zaretskii
  2015-01-31 11:10     ` Florian Weimer
  2015-02-01 16:08     ` Eli Zaretskii
  3 siblings, 2 replies; 32+ messages in thread
From: Jonathan Wakely @ 2015-01-31  1:55 UTC (permalink / raw)
  To: DJ Delorie; +Cc: Andrew Pinski, gcc, Jonny Grant

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.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-30 22:24     ` Kevin Ingwersen (Ingwie Phoenix)
@ 2015-01-31  1:57       ` Jonathan Wakely
  2015-01-31  5:30         ` Kevin Ingwersen (Ingwie Phoenix)
  2015-02-02 16:23       ` David Malcolm
  1 sibling, 1 reply; 32+ messages in thread
From: Jonathan Wakely @ 2015-01-31  1:57 UTC (permalink / raw)
  To: Kevin Ingwersen (Ingwie Phoenix)
  Cc: DJ Delorie, Andrew Pinski, gcc, Jonny Grant

On 30 January 2015 at 22:24, Kevin Ingwersen (Ingwie Phoenix) wrote:
> Apple’s HFS is, on a default OS X install, case insensitive.

Which doesn't matter, see my previous reply.

> But .c++ is valid. .cxx sounds pretty straight forward to me, since people also use the $CXX variable.

We already use .C and .cc in GCC sources, so even if we needed to
change it, it would probably be better to use .cc for consistency
rather than add a third extension.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-31  1:57       ` Jonathan Wakely
@ 2015-01-31  5:30         ` Kevin Ingwersen (Ingwie Phoenix)
  0 siblings, 0 replies; 32+ messages in thread
From: Kevin Ingwersen (Ingwie Phoenix) @ 2015-01-31  5:30 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: DJ Delorie, Andrew Pinski, gcc, Jonny Grant


> Am 31.01.2015 um 02:57 schrieb Jonathan Wakely <jwakely.gcc@gmail.com>:
> 
> On 30 January 2015 at 22:24, Kevin Ingwersen (Ingwie Phoenix) wrote:
>> Apple’s HFS is, on a default OS X install, case insensitive.
> 
> Which doesn't matter, see my previous reply.
That is true; though its good to keep an eye out for it.

>> But .c++ is valid. .cxx sounds pretty straight forward to me, since people also use the $CXX variable.
> 
> We already use .C and .cc in GCC sources, so even if we needed to
> change it, it would probably be better to use .cc for consistency
> rather than add a third extension.
Oh, I did not know this detail since I haven’t peered into the GCC source in a felt forever. Would make sense to use .cc then if it has already been used elsewhere in the source.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-31  1:55     ` Jonathan Wakely
@ 2015-01-31  8:03       ` John Marino
  2015-01-31  8:50         ` Andreas Schwab
  2015-02-01 16:09       ` Eli Zaretskii
  1 sibling, 1 reply; 32+ messages in thread
From: John Marino @ 2015-01-31  8:03 UTC (permalink / raw)
  To: Jonathan Wakely, DJ Delorie; +Cc: Andrew Pinski, gcc, Jonny Grant

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-31  8:03       ` John Marino
@ 2015-01-31  8:50         ` Andreas Schwab
  0 siblings, 0 replies; 32+ messages in thread
From: Andreas Schwab @ 2015-01-31  8:50 UTC (permalink / raw)
  To: John Marino; +Cc: Jonathan Wakely, DJ Delorie, Andrew Pinski, gcc, Jonny Grant

John Marino <gnugcc@marino.st> writes:

> Even if this issue is normally hidden due to gcc's makefiles

There are no makefiles involved.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-30 22:14   ` DJ Delorie
  2015-01-30 22:24     ` Kevin Ingwersen (Ingwie Phoenix)
  2015-01-31  1:55     ` Jonathan Wakely
@ 2015-01-31 11:10     ` Florian Weimer
  2015-01-31 12:18       ` Mikhail Maltsev
  2015-01-31 20:21       ` DJ Delorie
  2015-02-01 16:08     ` Eli Zaretskii
  3 siblings, 2 replies; 32+ messages in thread
From: Florian Weimer @ 2015-01-31 11:10 UTC (permalink / raw)
  To: DJ Delorie; +Cc: pinskia, gcc, Jonny Grant

* DJ Delorie:

> 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

Aren't current Windows file systems case-preserving?  Then they
shouldn't have no problems with .C files.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-31 11:10     ` Florian Weimer
@ 2015-01-31 12:18       ` Mikhail Maltsev
  2015-01-31 20:21       ` DJ Delorie
  1 sibling, 0 replies; 32+ messages in thread
From: Mikhail Maltsev @ 2015-01-31 12:18 UTC (permalink / raw)
  To: Florian Weimer, DJ Delorie; +Cc: pinskia, gcc, Jonny Grant

31.01.2015 14:10, Florian Weimer writes:
> Aren't current Windows file systems case-preserving?  Then they 
> shouldn't have no problems with .C files.

They are, but with some limitations: you can't create two files with
names differing only by case. I didn't try API functions, but here is
how it looks like in command line.

Linux:
$ touch a
$ touch A
$ touch B
$ ls
a  A  B

Cygwin (Windows 8.1, x64, NTFS):
$ touch a
$ touch A
$ touch B
$ ls
a  B

Windows command prompt (on same system):
>echo 1 > a
>echo 1 > A
>echo 1 > B
>dir
(several non-relevant lines omitted)
31.01.2015  14:58                 4 a
31.01.2015  14:58                 4 B

Renaming does work:

Cygwin:
$ mv ./a ./A
$ ls
A  B

Native:
>rename a A
>dir
(...)
31.01.2015  14:58                 4 A
31.01.2015  14:58                 4 B

-- 
Regards,
    Mikhail Maltsev

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-31 11:10     ` Florian Weimer
  2015-01-31 12:18       ` Mikhail Maltsev
@ 2015-01-31 20:21       ` DJ Delorie
  2015-01-31 20:41         ` Kevin Ingwersen (Ingwie Phoenix)
  1 sibling, 1 reply; 32+ messages in thread
From: DJ Delorie @ 2015-01-31 20:21 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc


> Aren't current Windows file systems case-preserving?  Then they
> shouldn't have no problems with .C files.

They are case preserving, but not case sensitive.  A wildcard search
for *.c will match foo.C and bar.c, and foo.c can be opened as FOO.C.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-31 20:21       ` DJ Delorie
@ 2015-01-31 20:41         ` Kevin Ingwersen (Ingwie Phoenix)
  0 siblings, 0 replies; 32+ messages in thread
From: Kevin Ingwersen (Ingwie Phoenix) @ 2015-01-31 20:41 UTC (permalink / raw)
  To: DJ Delorie; +Cc: Florian Weimer, gcc


> Am 31.01.2015 um 21:21 schrieb DJ Delorie <dj@redhat.com>:
> 
> 
>> Aren't current Windows file systems case-preserving?  Then they
>> shouldn't have no problems with .C files.
> 
> They are case preserving, but not case sensitive.  A wildcard search
> for *.c will match foo.C and bar.c, and foo.c can be opened as FOO.C.
That also applies to OS X:

$ head -n 1 build.it
/**
$ head -n 1 BUILD.IT
/**
$ head -n 1 BuIlD.iT
/**

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-30 22:14   ` DJ Delorie
                       ` (2 preceding siblings ...)
  2015-01-31 11:10     ` Florian Weimer
@ 2015-02-01 16:08     ` Eli Zaretskii
  3 siblings, 0 replies; 32+ messages in thread
From: Eli Zaretskii @ 2015-02-01 16:08 UTC (permalink / raw)
  To: DJ Delorie; +Cc: pinskia, gcc, jg

> From: DJ Delorie <dj@redhat.com>
> Cc: gcc@gcc.gnu.org, Jonny Grant <jg@jguk.org>
> Date: Fri, 30 Jan 2015 16:39:51 -0500
> 
> 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++).

Actually, Windows filesystems do allow '+' in file names.  (DOS
filesystems don't.)

But I agree that using it is not the best alternative, as the Windows
shell sometimes interprets '+' as a delimiter, so file names using
that character need to be quoted for safety.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-31  1:55     ` Jonathan Wakely
  2015-01-31  8:03       ` John Marino
@ 2015-02-01 16:09       ` Eli Zaretskii
  2015-02-01 16:34         ` Kevin Ingwersen (Ingwie Phoenix)
  1 sibling, 1 reply; 32+ messages in thread
From: Eli Zaretskii @ 2015-02-01 16:09 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: dj, pinskia, gcc, jg

> Date: Sat, 31 Jan 2015 01:55:29 +0000
> From: Jonathan Wakely <jwakely.gcc@gmail.com>
> Cc: Andrew Pinski <pinskia@gmail.com>, "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>, Jonny Grant <jg@jguk.org>
> 
> 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.

That is true for building GCC.  But what about editors and other
development tools?  They _will_ be affected.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-01 16:09       ` Eli Zaretskii
@ 2015-02-01 16:34         ` Kevin Ingwersen (Ingwie Phoenix)
  2015-02-02 21:11           ` Jonny Grant
  0 siblings, 1 reply; 32+ messages in thread
From: Kevin Ingwersen (Ingwie Phoenix) @ 2015-02-01 16:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Jonathan Wakely, dj, pinskia, gcc, jg


> Am 01.02.2015 um 17:09 schrieb Eli Zaretskii <eliz@gnu.org>:
> 
>> Date: Sat, 31 Jan 2015 01:55:29 +0000
>> From: Jonathan Wakely <jwakely.gcc@gmail.com>
>> Cc: Andrew Pinski <pinskia@gmail.com>, "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>, Jonny Grant <jg@jguk.org>
>> 
>> 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.
> 
> That is true for building GCC.  But what about editors and other
> development tools?  They _will_ be affected.

Indeed. Atom keeps thinking .C is an actual „ANSI C“ thing. If I were to make a suggestion to the GCC dev’s, then I probably could also swiftly word it as:

$ find gcc-src -name "*.C“ | while read f; do mv $f $(echo $f | sed 's/\.C/\.cxx/g’); done

In other words; .cxx, .cpp or .cc seems like a solution that works across platforms. Since .cc is already used at some places, I would recommend that this is to be the extension to choose.

One does not neccessarily need to make a dev apply hacks all over just to start development.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-01-30 22:24     ` Kevin Ingwersen (Ingwie Phoenix)
  2015-01-31  1:57       ` Jonathan Wakely
@ 2015-02-02 16:23       ` David Malcolm
  1 sibling, 0 replies; 32+ messages in thread
From: David Malcolm @ 2015-02-02 16:23 UTC (permalink / raw)
  To: Kevin Ingwersen (Ingwie Phoenix); +Cc: DJ Delorie, pinskia, gcc, Jonny Grant

On Fri, 2015-01-30 at 23:24 +0100, Kevin Ingwersen (Ingwie Phoenix)
wrote:
> > Am 30.01.2015 um 22:39 schrieb DJ Delorie <dj@redhat.com>:
> > 
> > 
> > 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++).
> 
> Apple’s HFS is, on a default OS X install, case insensitive. But .c++
> is valid. .cxx sounds pretty straight forward to me, since people also
> use the $CXX variable.

FWIW this bit the gcc-python-plugin when someone tried to build it on OS
X: I had a "foo.c" and a "foo.C" in the same directory, with different
content (can't remember the actual names, I think they were one of my
test cases).

IIRC this confused *git* on OS X no end (only one file could exist in
the working copy at once), until I fixed it by renaming the .C file
to .cc.

This error (albeit on my part) has rather turned me off ".C" files; I
use ".cc" in my own projects these days, fwiw.  I think as a general
rule one should avoid upper case in filename suffixes, for this kind of
reason.

Dave


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-01 16:34         ` Kevin Ingwersen (Ingwie Phoenix)
@ 2015-02-02 21:11           ` Jonny Grant
  2015-02-02 21:18             ` Andrew Pinski
  2015-02-02 23:56             ` Jonathan Wakely
  0 siblings, 2 replies; 32+ messages in thread
From: Jonny Grant @ 2015-02-02 21:11 UTC (permalink / raw)
  To: Kevin Ingwersen (Ingwie Phoenix), Eli Zaretskii
  Cc: Jonathan Wakely, dj, pinskia, gcc



On 01/02/15 16:34, Kevin Ingwersen (Ingwie Phoenix) wrote:
>
>> Am 01.02.2015 um 17:09 schrieb Eli Zaretskii <eliz@gnu.org>:
>>
>>> Date: Sat, 31 Jan 2015 01:55:29 +0000
>>> From: Jonathan Wakely <jwakely.gcc@gmail.com>
>>> Cc: Andrew Pinski <pinskia@gmail.com>, "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>, Jonny Grant <jg@jguk.org>
>>>
>>> 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.
>>
>> That is true for building GCC.  But what about editors and other
>> development tools?  They _will_ be affected.
>
> Indeed. Atom keeps thinking .C is an actual „ANSI C“ thing. If I were to make a suggestion to the GCC dev’s, then I probably could also swiftly word it as:
>
> $ find gcc-src -name "*.C“ | while read f; do mv $f $(echo $f | sed 's/\.C/\.cxx/g’); done
>
> In other words; .cxx, .cpp or .cc seems like a solution that works across platforms. Since .cc is already used at some places, I would recommend that this is to be the extension to choose.
>
> One does not neccessarily need to make a dev apply hacks all over just to start development.

Hello

Is this a consensus agreement to rename those .C -> .cc ?

Regards, Jonny

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-02 21:11           ` Jonny Grant
@ 2015-02-02 21:18             ` Andrew Pinski
  2015-02-03 22:55               ` Jonny Grant
  2015-02-02 23:56             ` Jonathan Wakely
  1 sibling, 1 reply; 32+ messages in thread
From: Andrew Pinski @ 2015-02-02 21:18 UTC (permalink / raw)
  To: Jonny Grant
  Cc: Kevin Ingwersen (Ingwie Phoenix),
	Eli Zaretskii, Jonathan Wakely, DJ Delorie, GCC Mailing List

On Mon, Feb 2, 2015 at 1:11 PM, Jonny Grant <jg@jguk.org> wrote:
>
>
> On 01/02/15 16:34, Kevin Ingwersen (Ingwie Phoenix) wrote:
>>
>>
>>> Am 01.02.2015 um 17:09 schrieb Eli Zaretskii <eliz@gnu.org>:
>>>
>>>> Date: Sat, 31 Jan 2015 01:55:29 +0000
>>>> From: Jonathan Wakely <jwakely.gcc@gmail.com>
>>>> Cc: Andrew Pinski <pinskia@gmail.com>, "gcc@gcc.gnu.org"
>>>> <gcc@gcc.gnu.org>, Jonny Grant <jg@jguk.org>
>>>>
>>>> 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.
>>>
>>>
>>> That is true for building GCC.  But what about editors and other
>>> development tools?  They _will_ be affected.
>>
>>
>> Indeed. Atom keeps thinking .C is an actual „ANSI C“ thing. If I were to
>> make a suggestion to the GCC dev’s, then I probably could also swiftly word
>> it as:
>>
>> $ find gcc-src -name "*.C“ | while read f; do mv $f $(echo $f | sed
>> 's/\.C/\.cxx/g’); done
>>
>> In other words; .cxx, .cpp or .cc seems like a solution that works across
>> platforms. Since .cc is already used at some places, I would recommend that
>> this is to be the extension to choose.
>>
>> One does not neccessarily need to make a dev apply hacks all over just to
>> start development.
>
>
> Hello
>
> Is this a consensus agreement to rename those .C -> .cc ?

There are around 11k files that have the .C ending to them; all in the
testsuite.  I don't think it make sense to move them.

Thanks,
Andrew

>
> Regards, Jonny
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-02 21:11           ` Jonny Grant
  2015-02-02 21:18             ` Andrew Pinski
@ 2015-02-02 23:56             ` Jonathan Wakely
  2015-02-16 17:45               ` Jonny Grant
  1 sibling, 1 reply; 32+ messages in thread
From: Jonathan Wakely @ 2015-02-02 23:56 UTC (permalink / raw)
  To: Jonny Grant
  Cc: Kevin Ingwersen (Ingwie Phoenix),
	Eli Zaretskii, DJ Delorie, Andrew Pinski, gcc

On 2 February 2015 at 21:11, Jonny Grant wrote:
> Is this a consensus agreement to rename those .C -> .cc ?

No.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-02 21:18             ` Andrew Pinski
@ 2015-02-03 22:55               ` Jonny Grant
  2015-02-03 23:21                 ` Andreas Schwab
  2015-02-03 23:24                 ` Joseph Myers
  0 siblings, 2 replies; 32+ messages in thread
From: Jonny Grant @ 2015-02-03 22:55 UTC (permalink / raw)
  To: Andrew Pinski
  Cc: Kevin Ingwersen (Ingwie Phoenix),
	Eli Zaretskii, Jonathan Wakely, DJ Delorie, GCC Mailing List



On 02/02/15 21:18, Andrew Pinski wrote:
> On Mon, Feb 2, 2015 at 1:11 PM, Jonny Grant <jg@jguk.org> wrote:
>>
>>
>> On 01/02/15 16:34, Kevin Ingwersen (Ingwie Phoenix) wrote:
>>>
>>>
>>>> Am 01.02.2015 um 17:09 schrieb Eli Zaretskii <eliz@gnu.org>:
>>>>
>>>>> Date: Sat, 31 Jan 2015 01:55:29 +0000
>>>>> From: Jonathan Wakely <jwakely.gcc@gmail.com>
>>>>> Cc: Andrew Pinski <pinskia@gmail.com>, "gcc@gcc.gnu.org"
>>>>> <gcc@gcc.gnu.org>, Jonny Grant <jg@jguk.org>
>>>>>
>>>>> 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.
>>>>
>>>>
>>>> That is true for building GCC.  But what about editors and other
>>>> development tools?  They _will_ be affected.
>>>
>>>
>>> Indeed. Atom keeps thinking .C is an actual „ANSI C“ thing. If I were to
>>> make a suggestion to the GCC dev’s, then I probably could also swiftly word
>>> it as:
>>>
>>> $ find gcc-src -name "*.C“ | while read f; do mv $f $(echo $f | sed
>>> 's/\.C/\.cxx/g’); done
>>>
>>> In other words; .cxx, .cpp or .cc seems like a solution that works across
>>> platforms. Since .cc is already used at some places, I would recommend that
>>> this is to be the extension to choose.
>>>
>>> One does not neccessarily need to make a dev apply hacks all over just to
>>> start development.
>>
>>
>> Hello
>>
>> Is this a consensus agreement to rename those .C -> .cc ?
>
> There are around 11k files that have the .C ending to them; all in the
> testsuite.  I don't think it make sense to move them.

How many minutes labor is this task?

Regards, Jonny

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-03 22:55               ` Jonny Grant
@ 2015-02-03 23:21                 ` Andreas Schwab
  2015-02-04  0:23                   ` Kevin Ingwersen (Ingwie Phoenix)
  2015-02-07 23:17                   ` Jonny Grant
  2015-02-03 23:24                 ` Joseph Myers
  1 sibling, 2 replies; 32+ messages in thread
From: Andreas Schwab @ 2015-02-03 23:21 UTC (permalink / raw)
  To: Jonny Grant
  Cc: Andrew Pinski, Kevin Ingwersen (Ingwie Phoenix),
	Eli Zaretskii, Jonathan Wakely, DJ Delorie, GCC Mailing List

Jonny Grant <jg@jguk.org> writes:

> How many minutes labor is this task?

What does it fix?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-03 22:55               ` Jonny Grant
  2015-02-03 23:21                 ` Andreas Schwab
@ 2015-02-03 23:24                 ` Joseph Myers
  1 sibling, 0 replies; 32+ messages in thread
From: Joseph Myers @ 2015-02-03 23:24 UTC (permalink / raw)
  To: Jonny Grant
  Cc: Andrew Pinski, Kevin Ingwersen (Ingwie Phoenix),
	Eli Zaretskii, Jonathan Wakely, DJ Delorie, GCC Mailing List

On Tue, 3 Feb 2015, Jonny Grant wrote:

> > There are around 11k files that have the .C ending to them; all in the
> > testsuite.  I don't think it make sense to move them.
> 
> How many minutes labor is this task?

It's desirable for test names to be stable so that results can be compared 
over time, which means a presumption that renaming an existing testcase is 
bad unless the name is really, really confusing (a pair testname-1.c and 
testname_1.c might count as confusing, but not test.C unless there's 
another very similar test in the same directory, in which case the "test" 
part would need changing).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-03 23:21                 ` Andreas Schwab
@ 2015-02-04  0:23                   ` Kevin Ingwersen (Ingwie Phoenix)
  2015-02-04  0:32                     ` Andrew Pinski
  2015-02-05  4:28                     ` Jonathan Wakely
  2015-02-07 23:17                   ` Jonny Grant
  1 sibling, 2 replies; 32+ messages in thread
From: Kevin Ingwersen (Ingwie Phoenix) @ 2015-02-04  0:23 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Jonny Grant, Andrew Pinski, Eli Zaretskii, Jonathan Wakely,
	DJ Delorie, GCC Mailing List


> Am 04.02.2015 um 00:20 schrieb Andreas Schwab <schwab@linux-m68k.org>:
> 
> Jonny Grant <jg@jguk.org> writes:
> 
>> How many minutes labor is this task?
> 
> What does it fix?

How many hacks/workarounds can be avoided?

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-04  0:23                   ` Kevin Ingwersen (Ingwie Phoenix)
@ 2015-02-04  0:32                     ` Andrew Pinski
  2015-02-05  4:28                     ` Jonathan Wakely
  1 sibling, 0 replies; 32+ messages in thread
From: Andrew Pinski @ 2015-02-04  0:32 UTC (permalink / raw)
  To: Kevin Ingwersen (Ingwie Phoenix)
  Cc: Andreas Schwab, Jonny Grant, Eli Zaretskii, Jonathan Wakely,
	DJ Delorie, GCC Mailing List

On Tue, Feb 3, 2015 at 4:22 PM, Kevin Ingwersen (Ingwie Phoenix)
<ingwie2000@googlemail.com> wrote:
>
>> Am 04.02.2015 um 00:20 schrieb Andreas Schwab <schwab@linux-m68k.org>:
>>
>> Jonny Grant <jg@jguk.org> writes:
>>
>>> How many minutes labor is this task?
>>
>> What does it fix?
>
> How many hacks/workarounds can be avoided?


None.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-04  0:23                   ` Kevin Ingwersen (Ingwie Phoenix)
  2015-02-04  0:32                     ` Andrew Pinski
@ 2015-02-05  4:28                     ` Jonathan Wakely
  1 sibling, 0 replies; 32+ messages in thread
From: Jonathan Wakely @ 2015-02-05  4:28 UTC (permalink / raw)
  To: Kevin Ingwersen (Ingwie Phoenix)
  Cc: Andreas Schwab, Jonny Grant, Andrew Pinski, Eli Zaretskii,
	DJ Delorie, GCC Mailing List

On 4 February 2015 at 00:22, Kevin Ingwersen (Ingwie Phoenix) wrote:
> How many hacks/workarounds can be avoided?

How many new hacks/workaround will be needed for exploring the files'
version control history, even with a VCS that supports renaming?

Renaming the files has downsides as well as upsides.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-03 23:21                 ` Andreas Schwab
  2015-02-04  0:23                   ` Kevin Ingwersen (Ingwie Phoenix)
@ 2015-02-07 23:17                   ` Jonny Grant
  2015-02-08 12:04                     ` Oleg Endo
  1 sibling, 1 reply; 32+ messages in thread
From: Jonny Grant @ 2015-02-07 23:17 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Andrew Pinski, Kevin Ingwersen (Ingwie Phoenix),
	Eli Zaretskii, Jonathan Wakely, DJ Delorie, GCC Mailing List


On 03/02/15 23:20, Andreas Schwab wrote:
> Jonny Grant <jg@jguk.org> writes:
>
>> How many minutes labor is this task?
>
> What does it fix?

Consistency. Less important if these files are only compiled after GCC 
available, to use as a testsuite. Although I understood from other 
replies that other files needed hacks to get them to compile.

However, if this suggestion isn't supported, there's no benefit of 
discussing further.

Jonny

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-07 23:17                   ` Jonny Grant
@ 2015-02-08 12:04                     ` Oleg Endo
  0 siblings, 0 replies; 32+ messages in thread
From: Oleg Endo @ 2015-02-08 12:04 UTC (permalink / raw)
  To: Jonny Grant
  Cc: Andreas Schwab, Andrew Pinski, Kevin Ingwersen (Ingwie Phoenix),
	Eli Zaretskii, Jonathan Wakely, DJ Delorie, GCC Mailing List

On Sat, 2015-02-07 at 23:17 +0000, Jonny Grant wrote:
> On 03/02/15 23:20, Andreas Schwab wrote:
> > Jonny Grant <jg@jguk.org> writes:
> >
> >> How many minutes labor is this task?
> >
> > What does it fix?
> 
> Consistency. Less important if these files are only compiled after GCC 
> available, to use as a testsuite. Although I understood from other 
> replies that other files needed hacks to get them to compile.
> 
> However, if this suggestion isn't supported, there's no benefit of 
> discussing further.

This whole filename stuff has been discussed already a while ago:
https://gcc.gnu.org/ml/gcc/2012-08/msg00310.html

Cheers,
Oleg


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-02 23:56             ` Jonathan Wakely
@ 2015-02-16 17:45               ` Jonny Grant
  2015-02-16 18:10                 ` Jonathan Wakely
  0 siblings, 1 reply; 32+ messages in thread
From: Jonny Grant @ 2015-02-16 17:45 UTC (permalink / raw)
  To: Jonathan Wakely
  Cc: Kevin Ingwersen (Ingwie Phoenix),
	Eli Zaretskii, DJ Delorie, Andrew Pinski, gcc

On 2 February 2015 at 23:56, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 2 February 2015 at 21:11, Jonny Grant wrote:
>> Is this a consensus agreement to rename those .C -> .cc ?
>
> No.

While I remember:
Stroustrup lists C++ extensions as .cxx and .cpp
http://www.stroustrup.com/glossary.html

ISO sample sources use .cpp:
http://standards.iso.org/ittf/PubliclyAvailableStandards/c043351_ISO_IEC_TR_18015_2006(E).zip

.C in GCC sources was the only place I've ever seen it.

Regards, Jonny

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Rename C files to .c in GCC source
  2015-02-16 17:45               ` Jonny Grant
@ 2015-02-16 18:10                 ` Jonathan Wakely
  0 siblings, 0 replies; 32+ messages in thread
From: Jonathan Wakely @ 2015-02-16 18:10 UTC (permalink / raw)
  To: Jonny Grant
  Cc: Kevin Ingwersen (Ingwie Phoenix),
	Eli Zaretskii, DJ Delorie, Andrew Pinski, gcc

On 16 February 2015 at 17:45, Jonny Grant wrote:
> While I remember:
> Stroustrup lists C++ extensions as .cxx and .cpp
> http://www.stroustrup.com/glossary.html
>
> ISO sample sources use .cpp:
> http://standards.iso.org/ittf/PubliclyAvailableStandards/c043351_ISO_IEC_TR_18015_2006(E).zip
>
> .C in GCC sources was the only place I've ever seen it.

The first edition of TCPPPL just uses .c for C++ source files ("Files
containing function or data definitions must be suffixed by .c" p107)
but the recent 4th edition lists several conventions, including .C,
and it's also listed in the official C++ FAQ
https://isocpp.org/wiki/faq/coding-standards#src-file-ext (which
originated at http://www.parashift.com/c++-faq/src-file-ext.html)

Renaming them would be a lot of churn for no great benefit, and it
doesn't seem as though any of the people asking for a change are the
people who actually work with the files day in day out.

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2015-02-16 18:10 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-30 12:23 Rename C files to .c in GCC source Jonny Grant
2015-01-30 17:09 ` pinskia
2015-01-30 20:30   ` Jonny Grant
2015-01-30 22:15     ` Kevin Ingwersen (Ingwie Phoenix)
2015-01-30 22:14   ` DJ Delorie
2015-01-30 22:24     ` Kevin Ingwersen (Ingwie Phoenix)
2015-01-31  1:57       ` Jonathan Wakely
2015-01-31  5:30         ` Kevin Ingwersen (Ingwie Phoenix)
2015-02-02 16:23       ` David Malcolm
2015-01-31  1:55     ` Jonathan Wakely
2015-01-31  8:03       ` John Marino
2015-01-31  8:50         ` Andreas Schwab
2015-02-01 16:09       ` Eli Zaretskii
2015-02-01 16:34         ` Kevin Ingwersen (Ingwie Phoenix)
2015-02-02 21:11           ` Jonny Grant
2015-02-02 21:18             ` Andrew Pinski
2015-02-03 22:55               ` Jonny Grant
2015-02-03 23:21                 ` Andreas Schwab
2015-02-04  0:23                   ` Kevin Ingwersen (Ingwie Phoenix)
2015-02-04  0:32                     ` Andrew Pinski
2015-02-05  4:28                     ` Jonathan Wakely
2015-02-07 23:17                   ` Jonny Grant
2015-02-08 12:04                     ` Oleg Endo
2015-02-03 23:24                 ` Joseph Myers
2015-02-02 23:56             ` Jonathan Wakely
2015-02-16 17:45               ` Jonny Grant
2015-02-16 18:10                 ` Jonathan Wakely
2015-01-31 11:10     ` Florian Weimer
2015-01-31 12:18       ` Mikhail Maltsev
2015-01-31 20:21       ` DJ Delorie
2015-01-31 20:41         ` Kevin Ingwersen (Ingwie Phoenix)
2015-02-01 16:08     ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).