> You can specify a metavariable as matching an expression of an arbitrary > type, int, char *, etc. But parsing of function types in this position > does not seem to yet be supported.
Thanks for your clarification. Would you like to extend the capabilities of the semantic patch language for this use case with (variable) function return types? > That is good for debugging, but probably more brutal than what is wanted > in practice. Usually what is done in Linux code is to clean up the local > state and return some error code to the caller. I would prefer to put on the emergency brake in some use cases instead of keeping a software running without noticing an unexpected error situation. http://en.wikipedia.org/wiki/Crash-only_software > Yes, along the lines of the example I sent to Anders. I'm sorry that I am not as familiar with the presented "|" notation as you so far. Does it enable the selection between alternative filters? >> http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/kwsys/ProcessUNIX.c;hb=b9e3c243d476efa04479d253cfc4f76ecbdb6fe3#l2713 > > I looked at the code, but I don't see the problem in that case, since the > mentioned line is the header of a void function. How do you think about a usage of the return values from the function calls "read" and "write"? Excerpt from the source file "Source/kwsys/ProcessUNIX.c": static void kwsysProcessesSignalHandler(int signum // Line 2713 #if KWSYSPE_USE_SIGINFO , siginfo_t* info, void* ucontext #endif ) { [...] /* Signal all process objects that a child has terminated. */ { int i; for(i=0; i < kwsysProcesses.Count; ++i) { /* Set the pipe in a signalled state. */ char buf = 1; kwsysProcess* cp = kwsysProcesses.Processes[i]; kwsysProcess_ssize_t status= read(cp->PipeReadEnds[KWSYSPE_PIPE_SIGNAL], &buf, 1); status=write(cp->SignalPipe, &buf, 1); (void)status; } } [...] } Would this source code example need any fine-tuning with the help of a SmPL filter pattern application (for safety reasons)? Regards, Markus _______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
