Coccinelle archive on
 help / color / Atom feed
From: Markus Elfring <>
To: Julia Lawall <>
Cc: Coccinelle <>
Subject: Re: [Cocci] Pretty-printing of code for ternary operators?
Date: Thu, 4 Jul 2019 14:05:57 +0200
Message-ID: <> (raw)
In-Reply-To: <alpine.DEB.2.20.1907041343250.3517@hadrien>

>> elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch ../janitor/use_call_with_ternary_operator1.cocci ksm-excerpt1.c
>> …
>> +	list_add_tail(&mm_slot->mm_list,
>> +		      (ksm_run & KSM_RUN_UNMERGE) ? &ksm_mm_head.mm_list : &ksm_scan.mm_slot->mm_list);
> And this is unsatisfactory because why?

Such a transformation result could be acceptable if the generated line length
would be tolerated.
But the second function parameter should be reformatted if we would like to care
for the Linux coding style in such an use case finally.

> I don't think ? should be used if it is going to end up over multiple lines.

I got an other software development opinion.

> In any case, I already commented that you proposed code was unreadable.

I am also curious on how the clarification for a patch on a topic like
“NFS: Less function calls in show_pnfs()” will evolve further.

Cocci mailing list

      parent reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04  7:33 Markus Elfring
     [not found] ` <alpine.DEB.2.20.1907041233010.3517@hadrien>
2019-07-04 11:40   ` Markus Elfring
     [not found]     ` <alpine.DEB.2.20.1907041343250.3517@hadrien>
2019-07-04 12:05       ` Markus Elfring [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Coccinelle archive on

Archives are clonable:
	git clone --mirror cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ \
	public-inbox-index cocci

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox