Is there an automatic source code formatter that nicely wraps lines of C/C++?

GNU Indent has support for breaking long lines.

http://www.gnu.org/software/indent/manual/indent.html#SEC12


I've found uncrustify command line tool to be very usable. It has a tremendous number of options, and therefore is a bit hard, but after some practice, it is invaluable. The homepage is here: http://uncrustify.sourceforge.net/


Astyle 2.03 now support splitting lines based on max-code-length

http://astyle.sourceforge.net/astyle.html#_max-code-length

I have tested this, and it splits the line with max-code-length=80, but based on least possible change. I maximizes the amount of code in a line, and hence the breaks aren't always easy to read (but it breaks them)