gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

Remove C-style comments in frontend and prefer C++-style

Open CohenArthur opened this issue 3 years ago • 12 comments

CohenArthur avatar Nov 15 '22 11:11 CohenArthur

What is the difference?

jdupak avatar Nov 16 '22 13:11 jdupak

C uses /* ... */ and C++ uses // ....... But maybe that's not the question?

dkm avatar Nov 16 '22 17:11 dkm

C uses /* ... */ and C++ uses // ....... But maybe that's not the question?

Yes, thanks, that was the question. But this is the first time I hear of such distinction.

jdupak avatar Nov 16 '22 19:11 jdupak

Yeah, sorry about that. I made these issues when reading the reviews on the patches and should have explained some of them a little better :)

CohenArthur avatar Nov 17 '22 10:11 CohenArthur

For removing the c-style comments in frontend and prefer c++ style we can switch to " // "

anuragcs avatar Mar 27 '23 13:03 anuragcs

Yep exactly @anuragcs :) are you interested in working on this?

CohenArthur avatar Mar 28 '23 07:03 CohenArthur

@CohenArthur .. Yes I would love to contribute my share and work on following issue

anuragcs avatar Apr 05 '23 06:04 anuragcs

@anuragcs thanks! I've assigned you to the issue

CohenArthur avatar Apr 06 '23 11:04 CohenArthur

@CohenArthur I wish to learn about the expected file range of this issue, because I searched current code base with /* and got a result of 20015 hits in 1688 files among *.c, *.cc, *.h.

TieWay59 avatar Jun 14 '23 09:06 TieWay59

Only gcc/rust/, libgrust/, plus a few GCC/Rust-specific files elsewhere.

But I'm not convinced that such a mass-change is really a good use of everyone's time: to prepare the changes, and also the conflicts that arise when cherry-picking patches, including preparation of patches for upstream submission, etc.? I mean, there's no actual problem with /* [...] */-style comments?

tschwinge avatar Jun 14 '23 10:06 tschwinge

Only gcc/rust/, libgrust/, plus a few GCC/Rust-specific files elsewhere.

But I'm not convinced that such a mass-change is really a good use of everyone's time: to prepare the changes, and also the conflicts that arise when cherry-picking patches, including preparation of patches for upstream submission, etc.? I mean, there's no actual problem with /* [...] */-style comments?

I concur with @tschwinge that this commit is too large and can create significant difficulties in the review phase. We should handle this issue cautiously, perhaps by dividing the tasks into smaller parts. But still, we need a strong reason to do that @CohenArthur.

TieWay59 avatar Jun 14 '23 12:06 TieWay59

Here is an example of gcc/rust/ search result: https://github.com/search?q=repo%3ARust-GCC%2Fgccrs+%22%2F*%22+%28path%3A*.c+OR+path%3A*.cc+OR+path%3A*.h%29+path%3A%2F%5Egcc%5C%2Frust%5C%2F%2F+&type=code

There are 122 files in the result with more than 2K /*.

I saw some difficult comment pattern what would not be easy to convert:

https://github.com/Rust-GCC/gccrs/blob/b028c7ece2ad67236e55a38b776c0bf70408a53e/gcc/rust/lex/rust-token.h#L159-L162

TieWay59 avatar Jun 15 '23 06:06 TieWay59

Considering we haven't had any work done on this, and the fact that I agree with @tschwinge regarding the impact of this issue on everyone's time, I'll close it for now. I think we have more important things to focus on, and the rest of GCC is full of C-style comments anyway

CohenArthur avatar Apr 15 '24 11:04 CohenArthur