bug-indent
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: indent help wrt function return types


From: Mike Burrell
Subject: Fwd: indent help wrt function return types
Date: Wed, 27 Feb 2008 18:34:28 -0500

Hello! I posted this on gnu.utils.help with no response, and it was suggested that I try address@hidden instead. Any help would be appreciated. Sorry for the bother :)

Mike

From: Mike Burrell <address@hidden>
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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]