Hello,

when coccinelle automatically adds a newline after removing "{}" the
added newline has dangling whitespace corresponding to the indentation
level. Please see the attached test case and generated patch.

thanks
bye
        michael
void *foo(void)
{
    void *obj;

    obj = malloc(4711);
    if (!obj)
    {
        ERR("Out of memory!!11!!\n");
        return NULL;
    }
    return obj;
}
@@
identifier mem;
statement S;
@@
 mem = malloc(...);
 if (mem == NULL)
-{
-    ERR(...);
     S
-}
--- dangling.c
+++ /tmp/cocci-output-22354-584e27-dangling.c
@@ -4,9 +4,7 @@ void *foo(void)
 
     obj = malloc(4711);
     if (!obj)
-    {
-        ERR("Out of memory!!11!!\n");
         return NULL;
-    }
+    
     return obj;
 }
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to