How to debug/reformat C printf calls with lots of arguments in vim?

Posted by Costi on Stack Overflow See other posts from Stack Overflow or by Costi
Published on 2010-05-14T16:51:10Z Indexed on 2010/05/14 16:54 UTC
Read the original article Hit count: 256

Filed under:
|

I have a function call in a program that I'm maintaining has 28 arguments for a printf call. It's printing a lot of data in a CSV file. I have problems following finding where what goes and I have some mismatches in the parameters types. I enabled -Wall in gcc and I get warnings like:

n.c:495: warning: int format, pointer arg (arg 15)
n.c:495: warning: format argument is not a pointer (arg 16)
n.c:495: warning: double format, pointer arg (arg 23)

The function is like this:

fprintf (ConvFilePtr, "\"FORMAT3\"%s%04d%s%04d%s%s%s%d%s%c%s%d%c%s%s%s%s%s%s%s%11.lf%s%11.lf%s%11.lf%s%d\n", some_28_arguments_go_here);

I would like to know if there is a vim plugin that highlights the printf format specifier when i go with the cursor over a variable.

Other solutions? How to better reformat the code to make it more readable?

© Stack Overflow or respective owner

Related posts about c

    Related posts about vim