FAQ 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. FAQ - Why sparse?
  2. Q. Why not just use gcc?
  3. A. Gcc is big, complex, and the gcc maintainers are not interested in
  4. other uses of the gcc front-end. In fact, gcc has explicitly
  5. resisted splitting up the front and back ends and having some common
  6. intermediate language because of religious license issues - you can
  7. have multiple front ends and back ends, but they all have to be part
  8. of gcc and licensed under the GPL.
  9. This all (in my opinion) makes gcc development harder than it should
  10. be, and makes the end result very ungainly. With "sparse", the
  11. front-end is very explicitly separated into its own independent
  12. project, and is totally independent from the users. I don't want to
  13. know what you do in the back-end, because I don't think I _should_
  14. know or care.
  15. Q. Why not GPL?
  16. A. See the previous question: I personally think that the front end
  17. must be a totally separate project from the back end: any other
  18. approach just leads to insanity. However, at the same time clearly
  19. we cannot write intermediate files etc crud (since then the back end
  20. would have to re-parse the whole thing and would have to have its
  21. own front end and just do a lot of things that do not make any sense
  22. from a technical standpoint).
  23. I like the GPL, but as rms says, "Linus is just an engineer". I
  24. refuse to use a license if that license causes bad engineering
  25. decisions. I want the front-end to be considered a separate
  26. project, yet the GPL considers the required linking to make the
  27. combined thing a derived work. Which is against the whole point
  28. of 'sparse'.
  29. I'm not interested in code generation. I'm not interested in what
  30. other people do with their back-ends. I _am_ interested in making a
  31. good front-end, and "good" means that people find it usable. And
  32. they shouldn't be scared away by politics or licenses. If they want
  33. to make their back-end be BSD/MIT licensed, that's great. And if
  34. they want to have a proprietary back-end, that's ok by me too. It's
  35. their loss, not mine.
  36. Q. Does it really parse C?
  37. A. Yeah, well... It parses a fairly complete subset of "extended C" as
  38. defined by gcc. HOWEVER, since I don't believe in K&R syntax for
  39. function declarations or in giving automatic integer types, it
  40. doesn't do that. If you don't give types to your variables, they
  41. won't have any types, and you can't use them.
  42. Similarly, it will be very unhappy about undeclared functions,
  43. rather than just assuming they have type "int".
  44. Note that a large rationale for me doing this project is for type
  45. following, which to some degree explains why the thing is type-anal
  46. and refuses to touch the old-style pre-ANSI non-typed (or weakly
  47. typed) constructs. Maybe somebody else who is working on projects
  48. where pre-ANSI C makes sense might be more inclined to care about
  49. ancient C. It's open source, after all. Go wild.
  50. Q. What other sparse resources are available?
  51. A. Wiki: http://sparse.wiki.kernel.org/index.php/Main_Page
  52. Mailing list: linux-sparse@vger.kernel.org
  53. See http://vger.kernel.org/vger-lists.html#linux-sparse for subscription
  54. instructions and links to archives
  55. Git repo: git://git.kernel.org/pub/scm/devel/sparse/sparse.git
  56. gitweb: http://git.kernel.org/?p=devel/sparse/sparse.git