bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: recent typo in sig.c breaks Minix compilation


From: Martin D Kealey
Subject: Re: recent typo in sig.c breaks Minix compilation
Date: Sat, 19 Oct 2024 03:25:04 +1000

On Fri, 18 Oct 2024, 13:09 Oğuz, <oguzismailuysal@gmail.com> wrote:

> On Friday, October 18, 2024, Martin D Kealey <martin@kurahaupo.gen.nz>
> wrote:
>>
>> Talking of which, I note several places where there's a construct like:
>>
>> #ifdef FOO
>> > if (foo && zot)
>> > #else
>> > if (zot)
>> > #endif
>>
>>
>> Unfortunately this confuses both the indent program and some editors.
>>
>
> It looks a lot cleaner than the alternatives you provided.
>

I would a agree that my first suggestion is untidy, even ugly; I only
provide it because it is the minimal adjustment that allows "indent" to
function properly.

However my second suggestion is arguably *cleaner* than the current style,
since it doesn't mash up an asymmetric part of a compound statement, and is
an even better improvement where the entire #if/#endif group is (currently)
repeated.

But it requires thought and can't be automated. Is there some other
objection?

What are the names of these editors?
>

Ok that wasn't the best example of code that confuses editors.

The problematic code for editors looks like this:

#ifdef FOO
if (foo && zot) {
#else
if (bar && zot) {
#endif

Vim certainly does not like this, and if you have an editor that does NOT
get confused by this, I'd like to know. (Not counting editors that entirely
lack the ability to match braces.)

To be fair, cuddled braces on compound statements are the minority.

-Martin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]