coccinelle

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

 



Attempting to do transform using Coccinelle

if (foo != 0) {
   ...

->

if (foo) {
   ...

Coccinelle script attempt does not work

@@ expression x; @@
(
- x != 0
+ x
)

`spatch --parse-cocci script.cocci` appears to pass. A similar script
worked correctly

@@ expression x; @@
(
- x == 0
+ !x
)

I have read various papers and tutorials to no avail. I have tried
various other versions also with no success.

Any pointers most appreciated.

thanks,
Tobin.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux