public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* New file extension
@ 2013-07-27 13:42 Gabriel Dos Reis
  2013-07-29 14:09 ` Diego Novillo
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Gabriel Dos Reis @ 2013-07-27 13:42 UTC (permalink / raw)
  To: gcc

Hi,

I would like to suggest that new implementation files have
the '.cc' extension, unless they are meant to be processed
with a C compiler.  (I am not proposing wholesale renaming.)

-- Gaby

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

* Re: New file extension
  2013-07-27 13:42 New file extension Gabriel Dos Reis
@ 2013-07-29 14:09 ` Diego Novillo
  2013-07-29 16:12 ` Marek Polacek
  2013-07-29 20:08 ` Martin Jambor
  2 siblings, 0 replies; 23+ messages in thread
From: Diego Novillo @ 2013-07-29 14:09 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: gcc

On Sat, Jul 27, 2013 at 9:42 AM, Gabriel Dos Reis
<gdr@integrable-solutions.net> wrote:
> Hi,
>
> I would like to suggest that new implementation files have
> the '.cc' extension, unless they are meant to be processed
> with a C compiler.  (I am not proposing wholesale renaming.)

Agreed.


Diego.

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

* Re: New file extension
  2013-07-27 13:42 New file extension Gabriel Dos Reis
  2013-07-29 14:09 ` Diego Novillo
@ 2013-07-29 16:12 ` Marek Polacek
  2013-07-29 18:53   ` Gabriel Dos Reis
  2013-07-29 20:08 ` Martin Jambor
  2 siblings, 1 reply; 23+ messages in thread
From: Marek Polacek @ 2013-07-29 16:12 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: gcc

On Sat, Jul 27, 2013 at 08:42:16AM -0500, Gabriel Dos Reis wrote:
> Hi,
> 
> I would like to suggest that new implementation files have
> the '.cc' extension, unless they are meant to be processed
> with a C compiler.  (I am not proposing wholesale renaming.)

Oh, I suppose this applies to ubsan, e.g.  (Haven't commited
it to trunk yet, but so far the files still have the '.c'
extension.)  Will rename it then, though I like '.c' more ;).

	Marek

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

* Re: New file extension
  2013-07-29 16:12 ` Marek Polacek
@ 2013-07-29 18:53   ` Gabriel Dos Reis
  0 siblings, 0 replies; 23+ messages in thread
From: Gabriel Dos Reis @ 2013-07-29 18:53 UTC (permalink / raw)
  To: Marek Polacek; +Cc: gcc

On Mon, Jul 29, 2013 at 11:11 AM, Marek Polacek <polacek@redhat.com> wrote:
> On Sat, Jul 27, 2013 at 08:42:16AM -0500, Gabriel Dos Reis wrote:
>> Hi,
>>
>> I would like to suggest that new implementation files have
>> the '.cc' extension, unless they are meant to be processed
>> with a C compiler.  (I am not proposing wholesale renaming.)
>
> Oh, I suppose this applies to ubsan,

yes. :-)

-- Gaby

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

* Re: New file extension
  2013-07-27 13:42 New file extension Gabriel Dos Reis
  2013-07-29 14:09 ` Diego Novillo
  2013-07-29 16:12 ` Marek Polacek
@ 2013-07-29 20:08 ` Martin Jambor
  2013-07-30  9:04   ` Marek Polacek
  2013-07-30 15:59   ` Gabriel Dos Reis
  2 siblings, 2 replies; 23+ messages in thread
From: Martin Jambor @ 2013-07-29 20:08 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: gcc

On Sat, Jul 27, 2013 at 08:42:16AM -0500, Gabriel Dos Reis wrote:
> Hi,
> 
> I would like to suggest that new implementation files have
> the '.cc' extension, unless they are meant to be processed
> with a C compiler.  (I am not proposing wholesale renaming.)
> 

I do not care very much but I disagree.  Having some files with .c
suffix and some with .cc suffix would imply some sort of difference
where there is going to be none.  Much more confusing than C++
compiled .c files, especially to newcomers, I suppose... and I though
we cared about them, that's the reason why I'm writing this email.  I
will not be surprised by this myself, so I can live with it.

Martin

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

* Re: New file extension
  2013-07-29 20:08 ` Martin Jambor
@ 2013-07-30  9:04   ` Marek Polacek
  2013-07-30 11:13     ` Diego Novillo
  2013-07-30 16:03     ` Gabriel Dos Reis
  2013-07-30 15:59   ` Gabriel Dos Reis
  1 sibling, 2 replies; 23+ messages in thread
From: Marek Polacek @ 2013-07-30  9:04 UTC (permalink / raw)
  To: Gabriel Dos Reis, gcc

On Mon, Jul 29, 2013 at 10:08:26PM +0200, Martin Jambor wrote:
> I do not care very much but I disagree.  Having some files with .c
> suffix and some with .cc suffix would imply some sort of difference
> where there is going to be none.

Yeah -- this sort of discrepancy I don't like either.  In gcc/, we
have 362 .c files and 0 .cc files, so every new .cc file will step out
of line...  That might be pain for people who are used to do
'grep foo gcc/*.c' and suchlike.

	Marek

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

* Re: New file extension
  2013-07-30  9:04   ` Marek Polacek
@ 2013-07-30 11:13     ` Diego Novillo
  2013-07-30 11:43       ` Basile Starynkevitch
                         ` (3 more replies)
  2013-07-30 16:03     ` Gabriel Dos Reis
  1 sibling, 4 replies; 23+ messages in thread
From: Diego Novillo @ 2013-07-30 11:13 UTC (permalink / raw)
  To: Marek Polacek; +Cc: Gabriel Dos Reis, gcc

On Tue, Jul 30, 2013 at 5:04 AM, Marek Polacek <polacek@redhat.com> wrote:
> On Mon, Jul 29, 2013 at 10:08:26PM +0200, Martin Jambor wrote:
>> I do not care very much but I disagree.  Having some files with .c
>> suffix and some with .cc suffix would imply some sort of difference
>> where there is going to be none.
>
> Yeah -- this sort of discrepancy I don't like either.  In gcc/, we
> have 362 .c files and 0 .cc files, so every new .cc file will step out
> of line...  That might be pain for people who are used to do
> 'grep foo gcc/*.c' and suchlike.

Any issues with doing a mass rename then?


Diego.

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

* Re: New file extension
  2013-07-30 11:13     ` Diego Novillo
@ 2013-07-30 11:43       ` Basile Starynkevitch
  2013-07-30 11:51         ` Joseph S. Myers
  2013-07-30 12:27       ` Marek Polacek
                         ` (2 subsequent siblings)
  3 siblings, 1 reply; 23+ messages in thread
From: Basile Starynkevitch @ 2013-07-30 11:43 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Marek Polacek, Gabriel Dos Reis, gcc

On Tue, Jul 30, 2013 at 07:13:22AM -0400, Diego Novillo wrote:
> On Tue, Jul 30, 2013 at 5:04 AM, Marek Polacek <polacek@redhat.com> wrote:
> > On Mon, Jul 29, 2013 at 10:08:26PM +0200, Martin Jambor wrote:
> >> I do not care very much but I disagree.  Having some files with .c
> >> suffix and some with .cc suffix would imply some sort of difference
> >> where there is going to be none.
> >
> > Yeah -- this sort of discrepancy I don't like either.  In gcc/, we
> > have 362 .c files and 0 .cc files, so every new .cc file will step out
> > of line...  That might be pain for people who are used to do
> > 'grep foo gcc/*.c' and suchlike.
> 
> Any issues with doing a mass rename then?


I think it is a good idea now (except perhaps for the very few source files
which could still be compiled by a plain C, not C++, compiler; maybe we 
don't have anymore them...).

FWIW, when compiling GCC trunk with Clang3.4 (i.e. on Debian/Sid+Experimental) 
I am getting warnings about *.c being a C++ file.

And I think newbies are distracted also by .c files being in C++ (not to mention
emacs or other editors being possibly confused).

So I am in favor of a massive renaming. (But please do it in one single huge svn commit).

Cheers
-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

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

* Re: New file extension
  2013-07-30 11:43       ` Basile Starynkevitch
@ 2013-07-30 11:51         ` Joseph S. Myers
  2013-07-30 12:30           ` Basile Starynkevitch
                             ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Joseph S. Myers @ 2013-07-30 11:51 UTC (permalink / raw)
  To: Basile Starynkevitch; +Cc: Diego Novillo, Marek Polacek, Gabriel Dos Reis, gcc

On Tue, 30 Jul 2013, Basile Starynkevitch wrote:

> I think it is a good idea now (except perhaps for the very few source files
> which could still be compiled by a plain C, not C++, compiler; maybe we 
> don't have anymore them...).

gcov-io.c is C code used for both host and target (one of the remaining 
bits of target library source not moved out of the gcc/ directory because 
of the complications of the dual way it's used), but it's used for the 
host (and built as C++ when so used) via #include in other .c files rather 
than being built directly.

Various Ada runtime library files are also .c under gcc/ada - in general, 
I'm not sure which .c files there are used as C, C++ or both, and which 
are used for host, target or both; that would require careful 
investigation for any renaming.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: New file extension
  2013-07-30 11:13     ` Diego Novillo
  2013-07-30 11:43       ` Basile Starynkevitch
@ 2013-07-30 12:27       ` Marek Polacek
  2013-07-30 12:35         ` Andrew MacLeod
  2013-07-30 12:28       ` Martin Jambor
  2013-07-30 16:01       ` Gabriel Dos Reis
  3 siblings, 1 reply; 23+ messages in thread
From: Marek Polacek @ 2013-07-30 12:27 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Gabriel Dos Reis, gcc

On Tue, Jul 30, 2013 at 07:13:22AM -0400, Diego Novillo wrote:
> On Tue, Jul 30, 2013 at 5:04 AM, Marek Polacek <polacek@redhat.com> wrote:
> > On Mon, Jul 29, 2013 at 10:08:26PM +0200, Martin Jambor wrote:
> >> I do not care very much but I disagree.  Having some files with .c
> >> suffix and some with .cc suffix would imply some sort of difference
> >> where there is going to be none.
> >
> > Yeah -- this sort of discrepancy I don't like either.  In gcc/, we
> > have 362 .c files and 0 .cc files, so every new .cc file will step out
> > of line...  That might be pain for people who are used to do
> > 'grep foo gcc/*.c' and suchlike.
> 
> Any issues with doing a mass rename then?

If various svn/git blame/log's would work, then I'm fine with it.
It's been discussed on gcc@ at some point; I don't remember any
major (dis)advantages.

Ok, I'll rename my new .c files to .cc.

	Marek

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

* Re: New file extension
  2013-07-30 11:13     ` Diego Novillo
  2013-07-30 11:43       ` Basile Starynkevitch
  2013-07-30 12:27       ` Marek Polacek
@ 2013-07-30 12:28       ` Martin Jambor
  2013-07-30 16:08         ` Gabriel Dos Reis
  2013-08-21 21:20         ` Steinar Bang
  2013-07-30 16:01       ` Gabriel Dos Reis
  3 siblings, 2 replies; 23+ messages in thread
From: Martin Jambor @ 2013-07-30 12:28 UTC (permalink / raw)
  To: GCC Mailing List

Hi,

On Tue, Jul 30, 2013 at 07:13:22AM -0400, Diego Novillo wrote:
> On Tue, Jul 30, 2013 at 5:04 AM, Marek Polacek <polacek@redhat.com> wrote:
> > On Mon, Jul 29, 2013 at 10:08:26PM +0200, Martin Jambor wrote:
> >> I do not care very much but I disagree.  Having some files with .c
> >> suffix and some with .cc suffix would imply some sort of difference
> >> where there is going to be none.
> >
> > Yeah -- this sort of discrepancy I don't like either.  In gcc/, we
> > have 362 .c files and 0 .cc files, so every new .cc file will step out
> > of line...  That might be pain for people who are used to do
> > 'grep foo gcc/*.c' and suchlike.
> 
> Any issues with doing a mass rename then?
> 

Well, IIRC mostly worries about history.  SVN claims to be able to
track history of renamed files but I use the git mirror now and I
wonder what the history would show there.  I would consider it very
unfortunate if 'git blame' did not show the .c era history of the
renamed files.  But maybe it would just work.

I think that proponents of this idea should make some experiments
along these lines to estimate the cost.  OTOH, I think the time can be
spent better (and that is also the reason why I will not fight about
this beyond writing this message).

As far as newbies are concerned, I think that grasping that .c files
are C++ files is one of the easy things to learn about GCC compared to
other necessary knowledge (which is something we should work on).

If the problem is that your emacs opens gcc files in C mode instead of
C++, add this to your .emacs file:

(add-to-list 'auto-mode-alist '("gcc/.+\\.[ch]\\'" . c++-mode))

Even after a rename you would have to do something like that for the
.h files anyway.

Thanks,

Martin

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

* Re: New file extension
  2013-07-30 11:51         ` Joseph S. Myers
@ 2013-07-30 12:30           ` Basile Starynkevitch
  2013-07-30 12:33           ` Eric Botcazou
  2013-07-30 16:05           ` Gabriel Dos Reis
  2 siblings, 0 replies; 23+ messages in thread
From: Basile Starynkevitch @ 2013-07-30 12:30 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: Diego Novillo, Marek Polacek, Gabriel Dos Reis, gcc

On Tue, Jul 30, 2013 at 11:51:35AM +0000, Joseph S. Myers wrote:
> On Tue, 30 Jul 2013, Basile Starynkevitch wrote:
> 
> > I think it is a good idea now (except perhaps for the very few source files
> > which could still be compiled by a plain C, not C++, compiler; maybe we 
> > don't have anymore them...).
> 
> gcov-io.c is C code used for both host and target (one of the remaining 
> bits of target library source not moved out of the gcc/ directory because 
> of the complications of the dual way it's used), but it's used for the 
> host (and built as C++ when so used) via #include in other .c files rather 
> than being built directly.
> 
> Various Ada runtime library files are also .c under gcc/ada - in general, 
> I'm not sure which .c files there are used as C, C++ or both, and which 
> are used for host, target or both; that would require careful 
> investigation for any renaming.

Ok. Then we could at leat rename to *.cc those files which are obviously directly
using C++ features (e.g. the class or virtual C++ keywords).

Maybe these files should before renaming have

   #ifndef __cplusplus
   #error should be compiled as C++ code
   #endif

??

Cheers

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

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

* Re: New file extension
  2013-07-30 11:51         ` Joseph S. Myers
  2013-07-30 12:30           ` Basile Starynkevitch
@ 2013-07-30 12:33           ` Eric Botcazou
  2013-07-30 16:05           ` Gabriel Dos Reis
  2 siblings, 0 replies; 23+ messages in thread
From: Eric Botcazou @ 2013-07-30 12:33 UTC (permalink / raw)
  To: Joseph S. Myers
  Cc: gcc, Basile Starynkevitch, Diego Novillo, Marek Polacek,
	Gabriel Dos Reis

> Various Ada runtime library files are also .c under gcc/ada - in general,
> I'm not sure which .c files there are used as C, C++ or both, and which
> are used for host, target or both; that would require careful
> investigation for any renaming.

The C files directly under ada/ cannot be renamed since they are meant to be 
compiled by the C compiler; only the ones under ada/gcc-interface can.

-- 
Eric Botcazou

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

* Re: New file extension
  2013-07-30 12:27       ` Marek Polacek
@ 2013-07-30 12:35         ` Andrew MacLeod
  2013-07-30 12:42           ` Marek Polacek
  0 siblings, 1 reply; 23+ messages in thread
From: Andrew MacLeod @ 2013-07-30 12:35 UTC (permalink / raw)
  To: Marek Polacek; +Cc: Diego Novillo, Gabriel Dos Reis, gcc

On 07/30/2013 08:27 AM, Marek Polacek wrote:
> On Tue, Jul 30, 2013 at 07:13:22AM -0400, Diego Novillo wrote:
>> On Tue, Jul 30, 2013 at 5:04 AM, Marek Polacek <polacek@redhat.com> wrote:
>>> On Mon, Jul 29, 2013 at 10:08:26PM +0200, Martin Jambor wrote:
>>>> I do not care very much but I disagree.  Having some files with .c
>>>> suffix and some with .cc suffix would imply some sort of difference
>>>> where there is going to be none.
>>> Yeah -- this sort of discrepancy I don't like either.  In gcc/, we
>>> have 362 .c files and 0 .cc files, so every new .cc file will step out
>>> of line...  That might be pain for people who are used to do
>>> 'grep foo gcc/*.c' and suchlike.
>> Any issues with doing a mass rename then?
I'd suggest waiting for a mass rename until the next stage 1... (or 
stage 0.9 :-) I will want to mass rename a lot of the files (ie, a lot 
of tree-* will lose the tree- prefix), and I think we'll be moving 
directory structures around as well... and some include files will be 
split up... etc. etc.    Seems like a logical time to change extensions too.

My point is, why go through the pain of changing a bunch of files now 
when we are probably going to do it again within a year.

Andrew

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

* Re: New file extension
  2013-07-30 12:35         ` Andrew MacLeod
@ 2013-07-30 12:42           ` Marek Polacek
  2013-07-30 16:09             ` Gabriel Dos Reis
  0 siblings, 1 reply; 23+ messages in thread
From: Marek Polacek @ 2013-07-30 12:42 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: Diego Novillo, Gabriel Dos Reis, gcc

On Tue, Jul 30, 2013 at 08:35:12AM -0400, Andrew MacLeod wrote:
> On 07/30/2013 08:27 AM, Marek Polacek wrote:
> >On Tue, Jul 30, 2013 at 07:13:22AM -0400, Diego Novillo wrote:
> >>On Tue, Jul 30, 2013 at 5:04 AM, Marek Polacek <polacek@redhat.com> wrote:
> >>>On Mon, Jul 29, 2013 at 10:08:26PM +0200, Martin Jambor wrote:
> >>>>I do not care very much but I disagree.  Having some files with .c
> >>>>suffix and some with .cc suffix would imply some sort of difference
> >>>>where there is going to be none.
> >>>Yeah -- this sort of discrepancy I don't like either.  In gcc/, we
> >>>have 362 .c files and 0 .cc files, so every new .cc file will step out
> >>>of line...  That might be pain for people who are used to do
> >>>'grep foo gcc/*.c' and suchlike.
> >>Any issues with doing a mass rename then?
> I'd suggest waiting for a mass rename until the next stage 1... (or
> stage 0.9 :-) I will want to mass rename a lot of the files (ie, a
> lot of tree-* will lose the tree- prefix), and I think we'll be
> moving directory structures around as well... and some include files
> will be split up... etc. etc.    Seems like a logical time to change
> extensions too.
> 
> My point is, why go through the pain of changing a bunch of files
> now when we are probably going to do it again within a year.

On second thought, yes, waiting for mass rename sounds better than to
add one .cc file...

	Marek

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

* Re: New file extension
  2013-07-29 20:08 ` Martin Jambor
  2013-07-30  9:04   ` Marek Polacek
@ 2013-07-30 15:59   ` Gabriel Dos Reis
  1 sibling, 0 replies; 23+ messages in thread
From: Gabriel Dos Reis @ 2013-07-30 15:59 UTC (permalink / raw)
  To: Gabriel Dos Reis, gcc

On Mon, Jul 29, 2013 at 3:08 PM, Martin Jambor <mjambor@suse.cz> wrote:
> On Sat, Jul 27, 2013 at 08:42:16AM -0500, Gabriel Dos Reis wrote:
>> Hi,
>>
>> I would like to suggest that new implementation files have
>> the '.cc' extension, unless they are meant to be processed
>> with a C compiler.  (I am not proposing wholesale renaming.)
>>
>
> I do not care very much but I disagree.  Having some files with .c
> suffix and some with .cc suffix would imply some sort of difference
> where there is going to be none.  Much more confusing than C++
> compiled .c files, especially to newcomers, I suppose... and I though
> we cared about them, that's the reason why I'm writing this email.  I
> will not be surprised by this myself, so I can live with it.
>
> Martin

We do care about newcomers, but with all these new projects
for refactoring, rewrites going on, I think you are worrying about
things that may start "big" now but will be vanishing as the
GCC project lives on.

-- Gaby

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

* Re: New file extension
  2013-07-30 11:13     ` Diego Novillo
                         ` (2 preceding siblings ...)
  2013-07-30 12:28       ` Martin Jambor
@ 2013-07-30 16:01       ` Gabriel Dos Reis
  3 siblings, 0 replies; 23+ messages in thread
From: Gabriel Dos Reis @ 2013-07-30 16:01 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Marek Polacek, gcc

On Tue, Jul 30, 2013 at 6:13 AM, Diego Novillo <dnovillo@google.com> wrote:
> On Tue, Jul 30, 2013 at 5:04 AM, Marek Polacek <polacek@redhat.com> wrote:
>> On Mon, Jul 29, 2013 at 10:08:26PM +0200, Martin Jambor wrote:
>>> I do not care very much but I disagree.  Having some files with .c
>>> suffix and some with .cc suffix would imply some sort of difference
>>> where there is going to be none.
>>
>> Yeah -- this sort of discrepancy I don't like either.  In gcc/, we
>> have 362 .c files and 0 .cc files, so every new .cc file will step out
>> of line...  That might be pain for people who are used to do
>> 'grep foo gcc/*.c' and suchlike.
>
> Any issues with doing a mass rename then?

I didn't want to open of the can of worm where would find
any reason to make this happen.  There might be genuine
concerns with people doing work on branches.

-- Gaby

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

* Re: New file extension
  2013-07-30  9:04   ` Marek Polacek
  2013-07-30 11:13     ` Diego Novillo
@ 2013-07-30 16:03     ` Gabriel Dos Reis
  1 sibling, 0 replies; 23+ messages in thread
From: Gabriel Dos Reis @ 2013-07-30 16:03 UTC (permalink / raw)
  To: Marek Polacek; +Cc: gcc

On Tue, Jul 30, 2013 at 4:04 AM, Marek Polacek <polacek@redhat.com> wrote:
> On Mon, Jul 29, 2013 at 10:08:26PM +0200, Martin Jambor wrote:
>> I do not care very much but I disagree.  Having some files with .c
>> suffix and some with .cc suffix would imply some sort of difference
>> where there is going to be none.
>
> Yeah -- this sort of discrepancy I don't like either.  In gcc/, we
> have 362 .c files and 0 .cc files, so every new .cc file will step out
> of line...

Any thing *new* steps out of line for someone.
Putting C++ programs in .c file is out of line for most people,
including the newcomers that people worry about.

For many tools, including editors, .c is a C file, not a C++ file,
so you don't get the benefit of working with a C++ program.

> That might be pain for people who are used to do
> 'grep foo gcc/*.c' and suchlike.
>
>         Marek

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

* Re: New file extension
  2013-07-30 11:51         ` Joseph S. Myers
  2013-07-30 12:30           ` Basile Starynkevitch
  2013-07-30 12:33           ` Eric Botcazou
@ 2013-07-30 16:05           ` Gabriel Dos Reis
  2 siblings, 0 replies; 23+ messages in thread
From: Gabriel Dos Reis @ 2013-07-30 16:05 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: Basile Starynkevitch, Diego Novillo, Marek Polacek, gcc

On Tue, Jul 30, 2013 at 6:51 AM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> On Tue, 30 Jul 2013, Basile Starynkevitch wrote:
>
>> I think it is a good idea now (except perhaps for the very few source files
>> which could still be compiled by a plain C, not C++, compiler; maybe we
>> don't have anymore them...).
>
> gcov-io.c is C code used for both host and target (one of the remaining
> bits of target library source not moved out of the gcc/ directory because
> of the complications of the dual way it's used), but it's used for the
> host (and built as C++ when so used) via #include in other .c files rather
> than being built directly.

This is a good example of what I meant originally by "unless they are
meant to be processed by a C compiler."

> Various Ada runtime library files are also .c under gcc/ada - in general,
> I'm not sure which .c files there are used as C, C++ or both, and which
> are used for host, target or both; that would require careful
> investigation for any renaming.

Indeed.

-- Gaby

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

* Re: New file extension
  2013-07-30 12:28       ` Martin Jambor
@ 2013-07-30 16:08         ` Gabriel Dos Reis
  2013-07-31 13:33           ` Martin Jambor
  2013-08-21 21:20         ` Steinar Bang
  1 sibling, 1 reply; 23+ messages in thread
From: Gabriel Dos Reis @ 2013-07-30 16:08 UTC (permalink / raw)
  To: GCC Mailing List

On Tue, Jul 30, 2013 at 7:28 AM, Martin Jambor <mjambor@suse.cz> wrote:

> As far as newbies are concerned, I think that grasping that .c files
> are C++ files is one of the easy things to learn about GCC compared to
> other necessary knowledge (which is something we should work on).

One more oddities compared to standard practice.

> If the problem is that your emacs opens gcc files in C mode instead of
> C++, add this to your .emacs file:
>
> (add-to-list 'auto-mode-alist '("gcc/.+\\.[ch]\\'" . c++-mode))

More oddities: we assume Emacs, and we want people to add those things.
Are we sure we are worrying about newcomers, or just fighting to preserve
the way things used to be 20 years?

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

* Re: New file extension
  2013-07-30 12:42           ` Marek Polacek
@ 2013-07-30 16:09             ` Gabriel Dos Reis
  0 siblings, 0 replies; 23+ messages in thread
From: Gabriel Dos Reis @ 2013-07-30 16:09 UTC (permalink / raw)
  To: Marek Polacek; +Cc: Andrew MacLeod, Diego Novillo, gcc

On Tue, Jul 30, 2013 at 7:42 AM, Marek Polacek <polacek@redhat.com> wrote:
> On Tue, Jul 30, 2013 at 08:35:12AM -0400, Andrew MacLeod wrote:
>> On 07/30/2013 08:27 AM, Marek Polacek wrote:
>> >On Tue, Jul 30, 2013 at 07:13:22AM -0400, Diego Novillo wrote:
>> >>On Tue, Jul 30, 2013 at 5:04 AM, Marek Polacek <polacek@redhat.com> wrote:
>> >>>On Mon, Jul 29, 2013 at 10:08:26PM +0200, Martin Jambor wrote:
>> >>>>I do not care very much but I disagree.  Having some files with .c
>> >>>>suffix and some with .cc suffix would imply some sort of difference
>> >>>>where there is going to be none.
>> >>>Yeah -- this sort of discrepancy I don't like either.  In gcc/, we
>> >>>have 362 .c files and 0 .cc files, so every new .cc file will step out
>> >>>of line...  That might be pain for people who are used to do
>> >>>'grep foo gcc/*.c' and suchlike.
>> >>Any issues with doing a mass rename then?
>> I'd suggest waiting for a mass rename until the next stage 1... (or
>> stage 0.9 :-) I will want to mass rename a lot of the files (ie, a
>> lot of tree-* will lose the tree- prefix), and I think we'll be
>> moving directory structures around as well... and some include files
>> will be split up... etc. etc.    Seems like a logical time to change
>> extensions too.
>>
>> My point is, why go through the pain of changing a bunch of files
>> now when we are probably going to do it again within a year.
>
> On second thought, yes, waiting for mass rename sounds better than to
> add one .cc file...
>
>         Marek

I am skeptical we would be able to implement mass renaming.

-- Gaby

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

* Re: New file extension
  2013-07-30 16:08         ` Gabriel Dos Reis
@ 2013-07-31 13:33           ` Martin Jambor
  0 siblings, 0 replies; 23+ messages in thread
From: Martin Jambor @ 2013-07-31 13:33 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: GCC Mailing List

Hi,

On Tue, Jul 30, 2013 at 11:07:52AM -0500, Gabriel Dos Reis wrote:
> On Tue, Jul 30, 2013 at 7:28 AM, Martin Jambor <mjambor@suse.cz> wrote:
> 
> > As far as newbies are concerned, I think that grasping that .c files
> > are C++ files is one of the easy things to learn about GCC compared to
> > other necessary knowledge (which is something we should work on).
> 
> One more oddities compared to standard practice.
> 
> > If the problem is that your emacs opens gcc files in C mode instead of
> > C++, add this to your .emacs file:
> >
> > (add-to-list 'auto-mode-alist '("gcc/.+\\.[ch]\\'" . c++-mode))
> 
> More oddities: we assume Emacs, and we want people to add those things.
> Are we sure we are worrying about newcomers, or just fighting to preserve
> the way things used to be 20 years?

I am quite sure.  You removed part of my email where I said I would
not mind mass renaming at all if git history was still easily usable.
This is not because I am some sort of crazy conservative, it is
because I use the history very often and I believe I am not alone.

Moreover, after reading Andrew's email in which he outlined a mass
renaming as a part of re-architecting gcc, I believe that waiting for
that to happen and having it happen is the best course of action (even
regardless of inconveniences with git history because that is not
going to be renaming for the sake of renaming but a substantial
change, worth doing nevertheless, or at least I hope so).

In the meantime, people can reconfigure their editor as I do with
emacs.

I still think that mixing C++ .c files and .cc files is silly and more
confusing than what we have now.  However, I can live with it.

As far as newcomers are concerned, I have joined GCC only about 6
years ago so I am still quite new and still remember my earliest days.
From my experience, the real obstacles are the tough issues to
overcome (like when you have an ICE in expr.c and there is no way you
can understand what is even going on there, let alone why it ICEs),
certainly not a number of small oddities.  If we really want to help
newcomers, we have to concentrate on the difficult stuff.  The simple
things usually do not really matter.

Furthermore, if we do a svn rename here and there, _mechanically_ turn
a struct into a class or a macro into a template (you noted I stressed
the word mechanically, right?) or remove some other small oddity at
the expense of making life of core gcc developers more difficult, the
newcomers will not even notice and the overall outcome will be
negative.  This is not trying to keep things as they were 20 years
ago, this is saying we should only make changes that make sense.  And
personally, I hope I will not only welcome such changes, but also be
able to help with them.

Martin

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

* Re: New file extension
  2013-07-30 12:28       ` Martin Jambor
  2013-07-30 16:08         ` Gabriel Dos Reis
@ 2013-08-21 21:20         ` Steinar Bang
  1 sibling, 0 replies; 23+ messages in thread
From: Steinar Bang @ 2013-08-21 21:20 UTC (permalink / raw)
  To: gcc

>>>>> Martin Jambor <mjambor@suse.cz>:

> Well, IIRC mostly worries about history.  SVN claims to be able to
> track history of renamed files but I use the git mirror now and I
> wonder what the history would show there.  I would consider it very
> unfortunate if 'git blame' did not show the .c era history of the
> renamed files.  But maybe it would just work.

It depends on how the rename if done.  If a file is added that has the
exact same SHA1 hash as a file with a different path, then git assumes
that the new file is a copy of the other file, and blame and the log
history can be made to follow the history beyond the copy.  Actually
"git blame" always follow the history across renames, and "git log"
needs the "--follow" option, or a config setting, to do so.

I have no idea what git-svn (or whatever) will do when it comes to an
svn rename, but it would make sense if it replicated it by a commit that
does a git rm of the file in the old location, and a git add of the file
in the new location.

If the svn rename also changes the renamed file, then things get
trickier... git-svn would have to split that commit into two.

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

end of thread, other threads:[~2013-08-21 17:55 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-27 13:42 New file extension Gabriel Dos Reis
2013-07-29 14:09 ` Diego Novillo
2013-07-29 16:12 ` Marek Polacek
2013-07-29 18:53   ` Gabriel Dos Reis
2013-07-29 20:08 ` Martin Jambor
2013-07-30  9:04   ` Marek Polacek
2013-07-30 11:13     ` Diego Novillo
2013-07-30 11:43       ` Basile Starynkevitch
2013-07-30 11:51         ` Joseph S. Myers
2013-07-30 12:30           ` Basile Starynkevitch
2013-07-30 12:33           ` Eric Botcazou
2013-07-30 16:05           ` Gabriel Dos Reis
2013-07-30 12:27       ` Marek Polacek
2013-07-30 12:35         ` Andrew MacLeod
2013-07-30 12:42           ` Marek Polacek
2013-07-30 16:09             ` Gabriel Dos Reis
2013-07-30 12:28       ` Martin Jambor
2013-07-30 16:08         ` Gabriel Dos Reis
2013-07-31 13:33           ` Martin Jambor
2013-08-21 21:20         ` Steinar Bang
2013-07-30 16:01       ` Gabriel Dos Reis
2013-07-30 16:03     ` Gabriel Dos Reis
2013-07-30 15:59   ` Gabriel Dos Reis

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