This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] New rules for ARI (was [commit] Get rid of build warnings on xtensa-tdep.c)


> so I tried to write a new rule
> to find out if functions that have no parameters
> do use () instead of (void).

Thanks!

>   While at it, I also tried to figure out if
> there were calls to functions in first lines
> (or prototype declarations with the function name at first line).

I think you meant first column?

> OK to add these two new rules?

I think they would be useful - but be sure to s/line/column/ in
the code as well:

> +# Only function implementation should be on first line
> +BEGIN { doc["function call in first line"] = "\
> +Function name in first line should be restricted to function
> implementation"
> +    category["function call in first line"] = ari_code
> +}
> +/^[a-z][a-z0-9_]*[[:space:]]*\((|[^*][^()]*)\)[[:space:]]*[^ \t]+/ {
> +    fail("function call in first line")
> +}

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]