[Cocci] [PATCH 1/1] btrfs: Deletion of unnecessary checks before six function calls

2014-10-31 Thread SF Markus Elfring
The following functions test whether their argument is NULL and then return immediately. * btrfs_free_path() * free_extent_buffer() * free_extent_map() * free_extent_state() * iput() * kfree() Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

Re: [Cocci] [PATCH 1/1] GPU-DRM-nouveau: Deletion of unnecessary checks before two function calls

2014-10-29 Thread SF Markus Elfring
If you are convinced that dropping the null tests is a good idea, then you can submit the patch that makes the change to the relevant maintainers and mailing lists. Would you like to integrate the following proposal into your source code repository? Regards, Markus From

Re: [Cocci] [PATCH 1/1] GPU-DRM-GMA500: Deletion of unnecessary checks before two function calls

2014-10-29 Thread SF Markus Elfring
If you are convinced that dropping the null tests is a good idea, then you can submit the patch that makes the change to the relevant maintainers and mailing lists. Would you like to integrate the following proposal into your source code repository? Regards, Markus From

Re: [Cocci] Addition of preprocessor statements with SmPL

2014-10-29 Thread SF Markus Elfring
I wanted to be able to re-run spatch on an already patched content. The use case is to add new function prototypes manually and run spatch to handle the associated #define automatically. Thanks for a bit more explanation. I imagine that you might need to specify more source code as adjustment

Re: [Cocci] Addition of preprocessor statements with SmPL

2014-10-29 Thread SF Markus Elfring
However, I fail to assemble those two patches in a single concise one. How do you think about the following approach? @Add_before_declaration@ identifier func; type t; @@ ( #define func BAR(func) t func(...); | +#define func BAR(func) t func(...); ) @Add_before_implementation@ identifier

Re: [Cocci] Addition of preprocessor statements with SmPL

2014-10-29 Thread SF Markus Elfring
@Add_before_implementation@ identifier func; type t; @@ ( #define func BAR(func) t func(...) { ... } | +#define func BAR(func) t func(...) { ... } ) This doesn't work. Interesting ... There is no kind of disjunction that includes a function definition in a branch. Was I

Re: [Cocci] Parsing errors in several headers

2014-10-29 Thread SF Markus Elfring
@@ identifier func; position p != s.p; @@ +#definefuncBAR(func) func(...) { ... } Will the shown position check really work when the variable p is not referenced in the patch specification block? Regards, Markus ___ Cocci mailing

Re: [Cocci] Parsing errors in several headers

2014-10-28 Thread SF Markus Elfring
Ok, then I must have a problem with my semantic patch, because it doesn't change anything :) I thought it was because of the parsing error. Would you like to show your SmPL approach here so that we could help you more eventually? Regards, Markus ___

Re: [Cocci] Remove unnecessary null pointer checks?

2014-10-26 Thread SF Markus Elfring
spatch version 1.0.0-rc20 with Python support and with PCRE support [...] Fatal error: exception Failure(Show_functions_with_input_pointer_validation: already tagged token: C code context I tried this small source code search out again. elfring@Sonne:~/Projekte/Coccinelle/janitor date \

Re: [Cocci] Searching for pass-through functions

2014-10-08 Thread SF Markus Elfring
For example are you only interested in pointers? I get the impression from the source files within the software repository for the operating system MINIX 3.3.0 that pointers are specified for input parameters (which will be also forwarded as return values) at 177 source code places while

Re: [Cocci] Searching for pass-through functions

2014-10-08 Thread SF Markus Elfring
It depends on what you specifically want to do with the information. I would like to reuse the extracted data to convert a function name list to a corresponding SmPL constraint. It might become interesting again if a generated long regular expression will work for further source code analysis.

Re: [Cocci] Searching for pass-through functions

2014-10-08 Thread SF Markus Elfring
Their relationship was determined by the shown analysis. Sure, but the only interest of a regular expression is to express, eg all of the functions that have a name that ends in alloc in a concise way. I have got a different opinion. Now I am trying to refresh interest for the safe

Re: [Cocci] Searching for pass-through functions

2014-10-07 Thread SF Markus Elfring
I have retried a source code analysis approach which was discussed a while ago. http://git.minix3.org/index.cgi?p=minix.git;a=summary elfring@Sonne:~/Projekte/MINIX/lokal date spatch.opt -timeout 30 -sp-file ~/Projekte/Coccinelle/lokal/demos/pass-through/list_pass-through_functions.cocci

Re: [Cocci] Configuration for alignment of function parameters?

2014-10-06 Thread SF Markus Elfring
Which seems to be waste of vertical space to me. I will look into it. Some counter must not be getting reset. How do you think about to make the parameter alignment configurable? Do other coding styles prefer the shown source code layout? Regards, Markus

Re: [Cocci] Searching for pass-through functions

2014-10-05 Thread SF Markus Elfring
In which time frame should such a SmPL script be usually executed? The rule is_pass_through asks it to analyze every input of every function. Perhaps it is not surprising that it takes some time. How are the chances to determine which implementation details from a source file like

Re: [Cocci] Searching for pass-through functions

2014-10-05 Thread SF Markus Elfring
The rule is_pass_through asks it to analyze every input of every function. Perhaps it is not surprising that it takes some time. I tried out another command variant again. elfring@Sonne:~/Projekte/Coccinelle/lokal/demos/pass-through date spatch.opt --timeout 30 --include-headers-for-types

Re: [Cocci] Searching for pass-through functions

2014-10-05 Thread SF Markus Elfring
You can use --show-trying to find on what function it gets stuck. 1. /usr/src/linux-stable/drivers/media/pci/ttpci/av7110_ipack.c … trying function: av7110_ipack_instant_repack timeout (we abort) … 2. /usr/src/linux-stable/drivers/net/fddi/skfp/ess.c … trying function:

Re: [Cocci] Searching for pass-through functions

2014-10-05 Thread SF Markus Elfring
If you give the option --profile, it will collect information about what it is doing. In particular, you can see which rules take a long time. Would you like to clarify corresponding profiling results in more detail? Regards, Markus ___ Cocci

Re: [Cocci] Searching for pass-through functions

2014-10-05 Thread SF Markus Elfring
Can the five issues on which I stumbled during the source code analysis be fixed anyhow (eventually without the addtion of --no-… command options)? For the timeouts, no they cannot. I am surprised by this answer. - How many processing hours will the desired analysis need for completion

Re: [Cocci] Searching for pass-through functions

2014-10-05 Thread SF Markus Elfring
For example are you only interested in pointers? I get the impression from the source files for the operating system Linux 3.16.3 that pointers are specified for input parameters (which will be also forwarded as return values) at 1280 source code places while integral data types are used 1913

Re: [Cocci] [PATCH v2 2/7] module: add extra argument for parse_params() callback

2014-10-04 Thread SF Markus Elfring
This adds an extra argument onto parse_params() to be used as a way to make the unused callback a bit more useful and generic by allowing the caller to pass on a data structure of its choice. How do you think about to work with more data type definitions for such callback functions? Regards,

[Cocci] Searching for pass-through functions

2014-10-04 Thread SF Markus Elfring
Hello, I have retried a source code analysis approach which was discussed a while ago. http://article.gmane.org/gmane.comp.version-control.coccinelle/1900 https://www.mail-archive.com/cocci%40diku.dk/msg01834.html elfring@Sonne:~/Projekte/Coccinelle/lokal/demos/pass-through spatch.opt -sp_file

Re: [Cocci] Searching for pass-through functions

2014-10-04 Thread SF Markus Elfring
How are the chances to complete the desired data extraction for all 23753 C files in a shorter time frame? Use the timeout option. I would like to avoid it because I do not really have got an overview for source file sizes and corresponding source code complexity. Then hopefully you can

Re: [Cocci] minor issue: pretty printing for modified functions as arguments

2014-10-03 Thread SF Markus Elfring
Subject: [PATCH] module: add extra argument for parse_params() callback This adds an extra argument onto parse_params() to be used as a way to make the unused callback a bit more useful and generic by allowing the caller to pass on a data structure of its choice. How do you think about to

Re: [Cocci] string parameter concatenation

2014-10-02 Thread SF Markus Elfring
nit.cocci: @@ expression list L; @@ - f(L); + g(L); Would it make sense and work to write a semantic patch rule like the following? @replacement@ @@ -f +g (L); Can the passed parameters be omitted from the desired adjustment by the plus line? Regards, Markus

Re: [Cocci] [PATCH with Coccinelle?] Deletion of unnecessary checks before specific function calls

2014-10-01 Thread SF Markus Elfring
If you are convinced that dropping the null tests is a good idea, then you can submit the patch that makes the change to the relevant maintainers and mailing lists. Hello, A couple of functions perform input parameter validation before their implementations will try further actions with

Re: [Cocci] string parameter concatenation

2014-10-01 Thread SF Markus Elfring
String made up of multiple concatenated strings are perhaps not so well supported. I don't think that automatic concatenation would be a good idea, because some users might not want it. Does the semantic patch language support to find source code places where values are constructed out of

Re: [Cocci] [coccicheck PATCH 2/5] Deletion of unnecessary checks before specific function calls

2014-10-01 Thread SF Markus Elfring
If you are convinced that dropping the null tests is a good idea, then you can submit the patch that makes the change to the relevant maintainers and mailing lists. From 1d2de3c3cfa43cc3c78a91200c41cef438b26a8f Mon Sep 17 00:00:00 2001 From: Markus Elfring elfr...@users.sourceforge.net Date:

Re: [Cocci] [coccicheck PATCH 3/5] Deletion of unnecessary checks before specific function calls

2014-10-01 Thread SF Markus Elfring
If you are convinced that dropping the null tests is a good idea, then you can submit the patch that makes the change to the relevant maintainers and mailing lists. From f4608fceec40b2b94aa9b4abe3bbb6d98ed5eed9 Mon Sep 17 00:00:00 2001 From: Markus Elfring elfr...@users.sourceforge.net Date:

Re: [Cocci] [coccicheck PATCH 1/5] Deletion of unnecessary checks before specific function calls

2014-10-01 Thread SF Markus Elfring
If you are convinced that dropping the null tests is a good idea, then you can submit the patch that makes the change to the relevant maintainers and mailing lists. From 48c9c4f61a7d7ea98538e02631a981a429281005 Mon Sep 17 00:00:00 2001 From: Markus Elfring elfr...@users.sourceforge.net Date:

Re: [Cocci] [coccicheck PATCH 4/5] Deletion of unnecessary checks before specific function calls

2014-10-01 Thread SF Markus Elfring
If you are convinced that dropping the null tests is a good idea, then you can submit the patch that makes the change to the relevant maintainers and mailing lists. From e6a21b920fcca2f6f01c9528909dc036a9b3bc41 Mon Sep 17 00:00:00 2001 From: Markus Elfring elfr...@users.sourceforge.net Date:

Re: [Cocci] main changes in 1.0.0-rc22

2014-10-01 Thread SF Markus Elfring
--parse-handler: This new option makes it possible to give a file name containing OCaml code to invoke on a parse error. It allows displaying the parse error in a custom format. Would you like to mention this parameter also in the documentation source file spatch_options.tex?

Re: [Cocci] minor issue: pretty printing for modified functions as arguments

2014-10-01 Thread SF Markus Elfring
Is there perhaps a coccinelle bugzilla to help keep track of minor issues like these? Do you find the available issue tracker useful? https://github.com/coccinelle/coccinelle/issues/ Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] Further ideas from the release 1.0.0-rc22

2014-09-30 Thread SF Markus Elfring
I thank you very much for your software improvements. If you need type information, but don't anticipate that any matching or transformation is needed that crosses the boundary between the header files and the .c file, then using this option can give a big performance improvement. Would

Re: [Cocci] Fix for lexing: empty token needed?

2014-09-30 Thread SF Markus Elfring
I have looked into my log files once more so that I can give you another feedback for a regexp problem. I can't reproduce this. I need the semantic patch. It seems that you could fix this issue with the software release 1.0.0-rc22. I have tried out the discussed approach on the source

Re: [Cocci] Documentation generation for the release 1.0.0-rc22

2014-09-30 Thread SF Markus Elfring
http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/tex%28ptmr8t.tfm%29 Thanks for your link. The tool RPM PBone Search was not on my radar screen for a while. Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] main changes in 1.0.0-rc22

2014-09-30 Thread SF Markus Elfring
The option --include-headers-for-types has been added. With this, you can use eg --all-includes and it will parse the header files to collect type information, but not try to do any subsequent matching or transformation in the header files. Would you like to mention this parameter also in

Re: [Cocci] Transformations for implementations of functions without explicit return type

2014-09-28 Thread SF Markus Elfring
The lack of a return type is not supported for KR functions. That is a pity. Now it seems that a function like my_free could only be adjusted after a patch will be applied from my bug report. https://github.com/gvelez17/glimpse/issues/6 How do you think about the possibility to transform more

[Cocci] Semantic patches for more file formats?

2014-09-15 Thread SF Markus Elfring
Hello, I hope that more files which can also contain data formats that are different from source code for the C programming language will be supported by a future semantic patch language implementation.

[Cocci] How to add a few declarations?

2014-09-12 Thread SF Markus Elfring
is there exemple of use of transformation on the vaargs part of a method ? Are you looking for a way to adjust source code with functions that contain an ellipsis in their signature? Would you like to inspect parameter lists? Regards, Markus ___ Cocci

Re: [Cocci] Transformations around variadic functions

2014-09-12 Thread SF Markus Elfring
Are you looking for a way to adjust source code with functions that contain an ellipsis in their signature? Would you like to inspect parameter lists? Yes exactly. There are some software development challenges in the corresponding handling of variadic functions.

Re: [Cocci] [PATCH 1/6] Coccinelle: Semantic patch for replacing puts with putc

2014-09-12 Thread SF Markus Elfring
Using seq_puts to write a one-character string is suboptimal, since puts has to call strlen(). Are there any more functions which work with such strings in a similar way? Would it make sense to look also at other function names? Regards, Markus ___

Re: [Cocci] How to add a few declarations?

2014-09-11 Thread SF Markus Elfring
So the idea is to replace a method by another one but to be able to do that, I need to add two new variables n_values and values. Have you got any expectations on the placement for the added variables? Do any other scopes (or separate statement blocks) matter here? Regards, Markus

Re: [Cocci] Conversion of similar function calls into one with a longer parameter

2014-09-10 Thread SF Markus Elfring
I'm trying to write a semantic patch to convert consecutive seq_puts() calls into a single one, with the string literals concatenated. My attempt below works fine when there are exactly two seq_puts() calls, but fails when there are more. How do you think about to process the corresponding

Re: [Cocci] patch for coccinelle's Makefile

2014-08-29 Thread SF Markus Elfring
I think the uninstall target can be made much simpler and robust. How do think about to combine also the affected file deletion commands into fewer calls with longer parameter lists if your prefer still to adjust a Make file directly? (I imagine that improvements for other build scripts would be

Re: [Cocci] patch for c's Makefile

2014-08-28 Thread SF Markus Elfring
I think the uninstall target can be made much simpler and robust. Should the build specification be corrected instead of an old generated Make file? https://github.com/coccinelle/coccinelle/blob/282fdcd007ab47a0684a2b7add0f88181d4f32da/configure.ac#L1 Regards, Markus

Re: [Cocci] Improvements for the build specification?

2014-08-28 Thread SF Markus Elfring
Probably. I don't know m4 though. I know this macro programming language to some degree. Unfortunately, further improvements on the affected build specification are blocked by Julia so far. How do you find the chances to change such a situation? Regards, Markus

Re: [Cocci] Improvements for the build specification?

2014-08-28 Thread SF Markus Elfring
I was just reporting upstream some patch I had to introduce in order to package coccinelle for OPAM so that 'make uninstall' always return success. Would you dare to extend your knowledge about the software Autotools and automake besides package management for OCaml? How do you think about to

Re: [Cocci] Clarification for dependencies in SmPL rules

2014-08-24 Thread SF Markus Elfring
Maybe it would be more efficient. But conceptually it is redundant. Thanks for your feedback. I would find it a bit clearer or safer to use a SmPL variable like r.i only if a corresponding dependency was specified on the rule beginning. Regards, Markus

Re: [Cocci] Clarification for dependencies in SmPL rules

2014-08-24 Thread SF Markus Elfring
On the other hand, the dependency is not always necessary, for example in the following case: @@ expression r.e; @@ It seems that you designed the semantic patch language in the way that a dependency will implicitly created because of a SmPL variable like r.e. I wonder if it would help

Re: [Cocci] Conversion of some pointer arithmetic to array indexing style

2014-08-18 Thread SF Markus Elfring
@@ expression e,x; identifier f; @@ + e-f[ - *( +... ( - (e-f + x) + x | + x - (x + e-f) ) ...+ - ) + ] Does the issue isomorphism matter in the shown addition? Regards, Markus ___ Cocci mailing list

Re: [Cocci] Conversion of some pointer arithmetic to array indexing style

2014-08-18 Thread SF Markus Elfring
Does the issue isomorphism matter in the shown addition? I don'tknw if there is one for the commutativity of addition. I try to clarify this implementation detail a bit more. If there is then the disjunction is not needed. I wondered if such a repetition can be avoided in the semantic

Re: [Cocci] Clarification for array indexing style

2014-08-18 Thread SF Markus Elfring
How about then ( e1 .@e2 f + x | e1 -@e2 f + x ) where e2 has pointer typw (or array type?) e2 on the . or - will pick up the entire innermost enclosing expression. Would such a semantic patch approach handle also longer reference chains? Regards, Markus

Re: [Cocci] cocci: char* indexing style for linux

2014-08-18 Thread SF Markus Elfring
I think for these kinds of problems it would be helpful to have a metavariable type that is somewhere in the middle of idexpression and expression. Something that matches an identifier or accessing a field in an identifier, or a field of a field of an identifier and so on. In the past I

Re: [Cocci] cocci: char* indexing style for linux

2014-08-17 Thread SF Markus Elfring
I would prefer to be able to convert *(skb-data + frame_size / 2 + 10) not to (skb-data + frame_size / 2)[10] but to skb-data[frame_size / 2 + 10] but I don't know how. How do you think about a bit more fine-tuning for the desired semantic patch? Can it be that the

Re: [Cocci] Conversion of some pointer arithmetic to array indexing style

2014-08-17 Thread SF Markus Elfring
I don't think so as any type or combination of arithmetic operations would then need to be specified by the spatch input script. I imagine that it will be occasionally useful to be more specific in such semantic patterns. @pointer_arithmetic@ identifier var, member, add; int num1, num2; @@ -

Re: [Cocci] [patch 119/197] scripts/coccinelle/free: Delete NULL test before freeing functions

2014-08-09 Thread SF Markus Elfring
+@r depends on context || report || org @ +expression E; +position p; +@@ + +* if (E) +* \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb\)(E); How do you think about to add the construct @p also behind the function name usb_free_urb? Is my previous update

Re: [Cocci] [patch 119/197] scripts/coccinelle/free: Delete NULL test before freeing functions?

2014-08-09 Thread SF Markus Elfring
I still don't think this should be done for any random function that performs a null test on its argument. The corrections involved here are not as trivial as they would seem. I would prefer to make the list of corresponding function names more complete. Often it is not the case that the

Re: [Cocci] [PATCH V3] scripts/coccinelle/free: Delete NULL test before freeing functions?

2014-06-29 Thread SF Markus Elfring
https://systeme.lip6.fr/pipermail/cocci/2014-March/000676.html http://marc.info/?l=kernel-janitorsm=139405971927100w=2 Regular expressions do not allow taking advantage of the optimizations provided by Coccinelle and are not easy for a reader to understand. I find that the application of

Re: [Cocci] [PATCH V3] scripts/coccinelle/free: Delete NULL test before freeing functions?

2014-06-29 Thread SF Markus Elfring
I hope you had information you wanted from Julia ? Yes. - I am waiting on another Coccinelle software release which will contain improvements for my feature requests and bug reports. I'm curious when I should retry proposed filter patterns. Regards, Markus

Re: [Cocci] [PATCH V3] scripts/coccinelle/free: Delete NULL test before freeing functions?

2014-06-28 Thread SF Markus Elfring
Sorry but I'm not working on coccinelle ; just did a small script for kernel tree. I would appreciate a more constructive feedback for my update suggestions around the topic Deletion of unnecessary checks before specific function calls. - Did you look at the concrete patches? - How do you

Re: [Cocci] varargs

2014-05-22 Thread SF Markus Elfring
is it possible to match varargs in function parameters somehow? For which source code adjustments do you imagine that such a filter capability would be needed for the handling of variable function arguments? Would you like to analyse any variable parameter lists? Regards, Markus

Re: [Cocci] semantic patch feasibility

2014-04-26 Thread SF Markus Elfring
Besides moving the function pointers assigned to the structure gpio_chip fields to the new struct gpio_chip_ops, a pointer to the new struct gpio_chip_ops has to be assigned to the struct gpio_chip .ops field. Will any macros become relevant for such a source code reorganisation? So where

Re: [Cocci] semantic patch feasibility

2014-04-25 Thread SF Markus Elfring
I'm doing a kernel wide change on a core API used by a lot of drivers (~250) so is a lot of work to do this manually and I can miss a driver when grepping the code. How do you identify your update candidates? Have you got any specific filter pattern in mind already? Your task will become more

Re: [Cocci] Road map after Coccinelle 1.0.0-rc21?

2014-04-15 Thread SF Markus Elfring
How are the chances to get the filter pattern to work which was created with an alternation of 893 function names? I have already stated that this is not a priority. I can understand that. First, it is not a reasonable use of Cocinelle. I find this feedback strange. Static source code

Re: [Cocci] Road map after Coccinelle 1.0.0-rc21?

2014-04-15 Thread SF Markus Elfring
Yu should use virtual identifiers, not huge regular expressions. Unfortunately, big regular expressions can not be passed by virtual identifiers to SmPL constraints so far. Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] Relevance of some regular expressions in SmPL

2014-04-15 Thread SF Markus Elfring
Th eidea is to pass the collected information one by on, eg using a make file. Not to use a regular expression at all. Regular expressions can be used to some degree in semantic patches for a while. I like that functionality in principle! I do not want to pass small data items by virtual

Re: [Cocci] Road map after Coccinelle 1.0.0-rc21?

2014-04-14 Thread SF Markus Elfring
Did you eventually reproduce exceptions from the handling of a bit smaller alternation in a SmPL constraint once more? Yes, I believe so. How are the chances to get the filter pattern to work which was created with an alternation of 893 function names? Would you like to reduce the

Re: [Cocci] Coccinelle 1.0.0-rc21: Clarification for coccilib.elems?

2014-04-14 Thread SF Markus Elfring
Why does it not work as expected? It seems that an installation is always needed. (No shortcut so far ... ?) It would be nice if the desired command will also work from a test directory directly. Regards, Markus ___ Cocci mailing list

Re: [Cocci] Software parallelisation?

2014-04-11 Thread SF Markus Elfring
Multithreading inside Coccinelle is currently a priority task, but not a highest priority one. Would you like to share any more ideas about corresponding software improvements? Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] Software parallelisation?

2014-04-11 Thread SF Markus Elfring
Ocaml is not multi-threaded because it does not have a garbage collector able to execute in multiple threads at the same time. This is being worked on seriously now, but is at least 2-3 years out on the horizon for a stable solution. Would you like to point out any concrete discussions about

Re: [Cocci] [PATCH] coccinelle: add pycocci wrapper for multithreaded support

2014-04-10 Thread SF Markus Elfring
I checked the profile results, the reason the jobs finish is some threads had no work or little work. Could you find out during the data processing which parts or files result in a special application behaviour you would like to point out here? Regards, Markus

Re: [Cocci] Clarification for source code style reformatting

2014-04-02 Thread SF Markus Elfring
The output is apparently correct and compilable. It is just not kernel style. I'm not sure there is a defect really, just wanted to bring it up. Maybe the first transform could be better written. It seems that the shown differences in source code formatting come from your first semantic

Re: [Cocci] Clarification for source code style reformatting

2014-04-02 Thread SF Markus Elfring
The intent of Coccinelle is that the output should follow the Linux coding guidelines. I would find it also useful to support other source code format styles. How do you think about corresponding configuration options for the pretty-printing functionality? Regards, Markus

Re: [Cocci] trivial linux code style reformatting

2014-04-02 Thread SF Markus Elfring
Indeed, it works mostly better, because Coccinelle takes charge of the interaction between the ) and the {, but if ther is some specific spacing in E, that will be lost. Would you like to clarify this implementation detail a bit more? Are there any chances that this software will become able

[Cocci] Improvements for source code analysis with inclusion of header files

2014-03-30 Thread SF Markus Elfring
Hello, Some filter patterns can be specified in the semantic patch language so that they will also work without inclusion of header files. Some other source code analysis approaches will need all relevant data (e. g. macros and type declarations) from them. Various compilers provide a

Re: [Cocci] Improvements for source code analysis with inclusion of header files

2014-03-30 Thread SF Markus Elfring
Not sure what more documentation one would want. I would find a clarification nice for details like the following. 1. Which C files are referenced here? 2. File formats for the cache 3. Explanation for abstract syntax trees in this context Regards, Markus

Re: [Cocci] Improvements for source code analysis with inclusion of header files

2014-03-30 Thread SF Markus Elfring
1. Which C files are referenced here? The ones Coccinelle was asked to work on. Do you distinguish headers from source files in this use case? 2. File formats for the cache Doesn't matter to the user. I guess that such information will become more interesting for other software

Re: [Cocci] Improvements for source code analysis with inclusion of header files

2014-03-30 Thread SF Markus Elfring
Do you distinguish headers from source files in this use case? No that I recall. Would you like to support any variant of precompiled header files? The software changes, or one wants to use Coccinelle with other options, and then one would rather start over with a new cache. I imagine

Re: [Cocci] How to exclude volatile data accesses in expressions with SmPL?

2014-03-27 Thread SF Markus Elfring
Coccinelle makes an effort to infer types. YOu may need to use eg --recursive-includes and --relax-include-path to get the most possible type information. It is nice when a simple filter pattern works in principle. A filter pattern which needs the knowledge about all data type details to

Re: [Cocci] Cooperation with OCaml batteries?

2014-03-17 Thread SF Markus Elfring
Would you like to help in resolving any corresponding system configuration challenges for such software? No, I personally would not. Thanks for your quick feedback. If you make an effort in this direction, you could contribute patches. I have tried out a small SmPL script which contains

Re: [Cocci] Clarification for OCaml scripts in SmPL

2014-03-14 Thread SF Markus Elfring
Could you explain in words what replace is supposed to do, for example? Yes, of course. It should replace each quotation mark in a string by two of this character. (Quotes should become duplicated.) I never use either for loops or Buffers. Which elements would you prefer to reuse from the

Re: [Cocci] Clarification for OCaml scripts in SmPL

2014-03-14 Thread SF Markus Elfring
Why would a file name contain a quote character. I do not really know how often this case happens in the world of detailed data processing. And if it does, what good will adding exxtra ones do you. I hope to ensure constraints for the used data formats. ... and your string will be

Re: [Cocci] Determination of the number for named function parameters

2014-03-14 Thread SF Markus Elfring
2. Comparison for the incidence of unnamed function parameters to all of them I am trying out a bit more preparation with OCaml script development for this report variant. @initialize:ocaml@ @@ module My_map = Map.Make(Int64) let m = ref My_map.empty let counting dir = let d =

Re: [Cocci] Clarification for OCaml scripts in SmPL

2014-03-12 Thread SF Markus Elfring
I imagine that in-place modification will be a more efficient approach for my use case. Is a kind of list buffer available? You can just add information to the front of the list, and then reverse it at the end if that is needed. I am trying to convert Python statements into similar OCaml

Re: [Cocci] Clarification for OCaml scripts in SmPL

2014-03-12 Thread SF Markus Elfring
let store_positions fun count places = current_function := fun; Does OCaml not like my name selection here? Do I accidentally stumble on another software development surprise with reserved key words? http://ocaml.org/learn/faq.html let store_positions fu count places = current_fu

Re: [Cocci] Selection of class libraries ...?

2014-03-10 Thread SF Markus Elfring
I didn't implement it, and I never use python. Would you like to suggest any references for class libraries which work in OCaml with popular data structures in a way I am used to from other programming languages? Is the convenience and software speed similar there? Regards, Markus

Re: [Cocci] Determination of the number for named function parameters

2014-03-09 Thread SF Markus Elfring
Would you like to clarify data analysis according to the current situation around coccilib.elems.TermList instance? I know nothing about this. I am surprised by this feedback. I assume that a corresponding interface description would be nice if I look at man 3cocci Coccilib. How are the

Re: [Cocci] Determination of the number for named function parameters

2014-03-09 Thread SF Markus Elfring
Without knowing what you mean by data analysis it is impossible to tell. I mean the existence check for a parameter like format or extraction of a position for the function signature. It is clear that there is some problem with ... matching a parameter-typed metavariable. Thanks that you

Re: [Cocci] Improvements for the SmPL grammar description?

2014-03-08 Thread SF Markus Elfring
The spaces around the [ ] means that they are tokens. I would appreciate if the distinction will become easier for such characters. Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci

Re: [Cocci] Remove unnecessary null pointer checks?

2014-02-26 Thread SF Markus Elfring
But it is not surprising that a regular expression with over 5000 options exceeds its capacity. A source code search with the following pattern found 893 functions which check their single parameter. @safety_check@ identifier work, input; type data_type; position pos; statement is, es; @@

Re: [Cocci] Remove unnecessary null pointer checks?

2014-02-24 Thread SF Markus Elfring
This example does not fit to my expectation because it seems that the function implementation does not refer to the passed values. I must correct my conclusion here. One function parameter is actually used in the condition !stack while the second parameter is forwarded to other function

Re: [Cocci] Remove unnecessary null pointer checks?

2014-02-23 Thread SF Markus Elfring
Not sure what you mean by extended. I would also like to try another source code search approach like the following. elfring@Sonne:~/Projekte/Coccinelle/janitor LINE='-' echo $LINE PAT=list_input_parameter_validation1.cocci cat $PAT echo $LINE SP=/usr/local/bin/spatch $SP --version

Re: [Cocci] Remove unnecessary null pointer checks?

2014-02-23 Thread SF Markus Elfring
Something goes wrong with the switch pattern. I would have to look into why. Thanks for your quick feedback. But I think that a switch is highly improbable for making such a test, so you could just drop it. I just try to make the discussed filter patterns as complete as possible. You may

Re: [Cocci] Remove unnecessary null pointer checks?

2014-02-22 Thread SF Markus Elfring
Not sure what you mean by extended. I have tried the following search pattern. @Show_functions_with_input_pointer_validation@ identifier fun, x; type t; @@ *fun(..., t* x, ...) { ... if (!x) return; ... } Will your current tool version 1.0.0-rc20 find also the kfree() functions?

Re: [Cocci] Remove unnecessary null pointer checks?

2014-02-22 Thread SF Markus Elfring
If you want to match a call to ZERO_OR_NULL_PTR, then you need to include that in the semantic patch. Coccinelle does not expand macros, so if doesn't see the relation to a NULL test. I have tried a command like the following a moment ago. elfring@Sonne:~/Projekte/Coccinelle/janitor

Re: [Cocci] [PATCH 1/2] coccinelle: mkdir ocaml/coccilib/ upon install

2013-12-03 Thread SF Markus Elfring
Well, I agree with you that this would be better, but I have the impression that the Makefile is not generated by autotools. The make files can not be properly regenerated because the build specification needs corresponding updates. I have tried to clarify the affected details before.

Re: [Cocci] version mismatch

2013-11-29 Thread SF Markus Elfring
This is a common problem that spatch --version is not correct; [...] Do the chances become better to improve the build specification so that a command like autoreconf will work again? Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] 1.0.0-rc17: Further fine-tuning for the build system?

2013-04-29 Thread SF Markus Elfring
It's NOT by badgering Coccinelle upstream and trying to get other people to argue your case for you. Which build system do you use for this software in Fedora? http://pkgs.fedoraproject.org/cgit/coccinelle.git/ Regards, Markus ___ Cocci mailing

Re: [Cocci] 1.0.0-rc16: Further fine-tuning for the build system?

2013-04-26 Thread SF Markus Elfring
It's NOT by badgering Coccinelle upstream If Julia will show more willingness to handle patches for the build system, I am going also to invest more efforts into concrete fixes. and trying to get other people to argue your case for you. I do not want that, too. But other software

<    1   2   3   4   5   6   7   >