C-Code Style new line after function return type? [message #792218] |
Mon, 06 February 2012 14:11  |
Eclipse User |
|
|
|
I'm trying to customize the Allman code style to match the particular local quirks of my company's c-code style document, but I can't find a "new line after" option for return type of a function, or before a call to "return".
I'm using CDT 8 with Indigo.
Function Formatting: The function return type MUST be on a line by itself preceding the function.
int
my_function(void)
not
int my_function(void)
Spacing around "return"
There MUST always be a blank line directly preceding a return statement within a given scope, except when there are no other statements within that scope. If a function does not return anything (i.e., is a void function), there MUST not be a blank line.
int
myfunc()
{
function_call();
return 1;
}
or
int
myfunc()
{
if (1 == 2)
{
return 1;
}
return 0;
}
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04686 seconds