Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"I tried - and failed - to come up with a reasonable grep pattern"

Is there a nice, light, better-than-betterthangrep[1] static analysis tool that would help with this sort of question? (I suspect the decay to pointer would, for example, elide this detail from llvm's IR?).

[1] http://beyondgrep.com/



Create a new compiler warning. My guess is that it wouldn't be that difficult to add: add a warning for using sizeof() on a value whose type is the result of array-pointer decay. If you really want the size of the pointer, then you can change the function parameter's type to the pointer type, or use a cast.


There is/was a refactoring DSL for parsing and modifying C code accurately, but I don't recall the name. If I remember correctly, it was produced by a French organization or university.


You're probably thinking of http://coccinelle.lip6.fr/sp.php?


Yes, I think that's right.


Clang plugins are pretty cool. The LibreOffice project uses them reasonably extensively.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: