On Thu, 12 Dec 2024, James K. Lowden wrote: > A word about C style, always a lively topic. For any files already > present in gcc, the existing style was followed, and any variation from > it is unintentional. Files related to the parser use K&R style. The > GENERIC interface and runtime library use Whitesmiths style. All C++ > code uses spaces for indentation. > > The COBOL front end has been and is being written by two guys with > decades of experience. We hope the code is a testament to that > experience. Our relatively recent experience, these last four years, > is that it has been more productive to keep using the styles to which > we've long become accustomed. The position of curly braces is hardly > any hindrance to read another's code, but it's a burden to write that > way. We think, 83,068 lines later, the proof of the pudding is in the > eating.
Regardless of formatting - which we should be able to mostly fix using automated tools - I think the GNU coding style principle that every function has a comment above it documenting the intended semantics for the function (including all its arguments and the return value) is something important for all coding styles, and not something that can be fixed with automated tools. So please make sure that every function has such a comment. (If you wish to use specially formatted comments for automatic extraction of internal API documentation, rather than e.g. GNU conventions with parameters named in uppercase in the comments, that might be a reasonable deviation. But regardless of how the comments are formatted, having the documentation of function semantics, including in particular the semantics of arguments and return value, is important.) -- Joseph S. Myers josmy...@redhat.com