Fwd: indent help wrt function return types

Mike Burrell <[email protected]>
Newsgroups gmane.comp.gnu.indent.bugs
Message-ID <[email protected]>
Hello! I posted this on gnu.utils.help with no response, and it was  
suggested that I try [email protected] instead. Any help would be  
appreciated. Sorry for the bother :)

Mike

From: Mike Burrell <[email protected]>
Newsgroups: gnu.utils.help
Subject: indent help wrt function return types
Date: Mon, 18 Feb 2008 14:49:21 GMT

Hello all!

I'm trying to come up with GNU Indent options that will get a C  
function with a storage class modifier (namely "static") to come out  
looking like:

static
int
foo(void)
{
         return 5;
}

I thought a simple "-psl" option would handle this, but unfortunately  
with -psl, that looks like:

static
         int
foo(void)
{
         return 5;
}

(if it's not clear, the "int" is indented one level, instead of being  
in the first column). I tried setting -ci0, -cli0, -p0, -d0, -di0,  
etc., trying to get that "int" to not indent, but I can't make it  
happen. For what it's worth, if the function returns a pointer type,  
then it works perfectly, e.g.:

static
int *
foo(void)
{
         return 0;
}

Also, if the function does not have a storage class modifier (i.e.,  
it's not "static"), then this problem doesn't come up.

Can anyone shed some light on what option I need to give indent to  
make the "int" always show up in the first column? Any help would be  
appreciated.

indent --version yields "GNU indent 2.2.9"

Thanks a bunch,
Mike
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.