All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] string parameter concatenation
@ 2014-10-01 13:02 Cyril Hrubis
  2014-10-01 13:08 ` Julia Lawall
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Cyril Hrubis @ 2014-10-01 13:02 UTC (permalink / raw)
  To: cocci

Hi!
I've found a small nit in the handling of strings that spans over
multiple lines:

nit.c:
int main(void)
{
        f("This is a string that continues to the next line"
          " just string continuation");
}

nit.cocci:
@@
expression list L;
@@
- f(L);
+ g(L);


spatch nit.cocci nit.c
init_defs_builtins: /usr/local/share/coccinelle/standard.h
HANDLING: nit.c
diff = 
--- nit.c
+++ /tmp/cocci-output-8374-71ffd9-nit.c
@@ -1,5 +1,4 @@
 int main(void)
 {
-       f("This is a string that continues to the next line"
-         " just string continuation");
+       g("This is a string that continues to the next line"" just string continuation");
 }

While this produces perfectly correct C code it would be nicer if the
strings were merged into one single C string. Othewise this still breaks
what LKML coding style says about being able to grep user-visible
strings in the source code.

-- 
Cyril Hrubis
chrubis at suse.cz

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

end of thread, other threads:[~2014-12-03  8:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-01 13:02 [Cocci] string parameter concatenation Cyril Hrubis
2014-10-01 13:08 ` Julia Lawall
2014-10-01 13:21   ` SF Markus Elfring
2014-10-01 13:26     ` Julia Lawall
2014-10-01 18:28   ` Luis R. Rodriguez
2014-10-02  9:35   ` Cyril Hrubis
2014-10-02 10:24     ` Julia Lawall
2014-10-02 12:52 ` SF Markus Elfring
2014-10-02 13:04   ` Julia Lawall
2014-10-02 13:07   ` Cyril Hrubis
2014-10-02 13:37     ` Julia Lawall
2014-10-02 13:42       ` Cyril Hrubis
2014-10-02 17:00 ` Julia Lawall
2014-10-06 10:25   ` Cyril Hrubis
2014-10-06 10:49     ` Julia Lawall
2014-10-06 11:02       ` [Cocci] Configuration for alignment of function parameters? SF Markus Elfring
2014-10-17  5:53     ` [Cocci] string parameter concatenation Julia Lawall
2014-12-03  8:33       ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.