Re[2]: [Gc] [PATCH 3/3] Use leading tabs followed by spaces.

Ivan Maidanski ivmai at mail.ru
Tue Jul 9 02:06:22 PDT 2013


 Hi Ondrej,

Thank you for trying to make GC source code well-formatted.

I use an editor which expands tabs (except for .mk files). So most files that I've edited over 5 years don't have tabs.
As for formatting, you could try but for this you should cleanly understand existing formatting rules (which are somewhat informal and seem to be documented nowhere, but you could check win32_threads.c - it's almost formatted according to our rules).

However there is trade-off between keeping a file strictly formated and applying modifications. E.g.:

{
<space><space><some code>
.... // many lines of code
<space><space><some code>
}

If I need to "ifdef" the above code, I do it like this (mostly) so that git diff reports only the code change (not the code+format change):
{
#ifdef ...
<space><space><some code>
.... // many lines of code
<space><space><some code>
#endif
}

Instead of:
{
#<space>ifdef ...
<space><space><space><space><some code>
.... // many lines of code
<space><space><space><space><some code>
#<space>endif
}

Regards,
Ivan

Mon,  8 Jul 2013, 19:54 +02:00 from Ondřej Bílka <neleai at seznam.cz>:
>On Mon, Jul 08, 2013 at 04:50:42PM +0000, Boehm, Hans wrote:
>> Ivan gets to decide this, but I've had issues with tab-based formatting and display inconsistencies.  diff files, for example, tend to be hard to read.  I'd lean towards just avoiding tabs, even if it makes the uncompressed source files larger.  But I don't have a strong opinion on the issue, and I was unfortunately never very consistent about this.
>
>OK, I will prepare patch with spaces only. 
>
>If I am not very consistent but program is then I want let program do
>this for me. 
>As I can check with empty git diff -w that nothing cannot go wrong I
>could add a hook which keeps tabs/spaces at perfect condition.
>
>> 
>> Hans
>> 
>> > -----Original Message-----
>> > From:  gc-bounces at linux.hpl.hp.com [mailto:gc-bounces at linux.hpl.hp.com]
>> > On Behalf Of Ondrej Bílka
>> > Sent: Monday, July 08, 2013 9:22 AM
>> > To:  gc at linux.hpl.hp.com
>> > Subject: [Gc] [PATCH 3/3] Use leading tabs followed by spaces.
>> > 
>> > If you want to keep policy of tabs followed by less than 8 spaces then you can
>> > apply following patch,
>> >  http://kam.mff.cuni.cz/~ondra/boehm_leading_space.patch
>> > 
>> > I keep these attached as it is 1.5MB message.
>> > 
>> > You could choose any policy you want as long as it is machine generable.
>> > Then we can for example use one variant at gcc side and other here and can
>> > freely switch between them.
>> > _______________________________________________
>> > Gc mailing list
>> >  Gc at linux.hpl.hp.com
>> >  http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
>
>-- 
>
>Plate voltage too low on demodulator tube
>_______________________________________________
>Gc mailing list
>Gc at linux.hpl.hp.com
>http://www.hpl.hp.com/hosted/linux/mail-archives/gc/


-- 
Иван Майданский
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://napali.hpl.hp.com/pipermail/gc/attachments/20130709/da3cf083/attachment.htm


More information about the Gc mailing list