tags:

views:

71

answers:

2

In Visual Studio 2003 using pure C, old-style function declarations do not show as global member i.e. void func(blah) int blah;{...}

This shows as a global member in the members dropdown:

void func(int blah)
{
    ...
}

This compiles, but old-style does not appear in the global members dropdown:

void func(blah)
int blah;
{
    ...
}

I am trying to use the new 'Calling Graph' functionality to analyse code, but as most of our legacy code uses the old-style function parameters, those functions are not recognized are not shown as Global Members, and therefore do not appear in the 'Calling Graph'.

Is there any way to let the "call graph" analysis process old-style function declarations correctly?

A: 

I'm not sure but maybe the engine uses regexs to trace routine signatures and the old C style isn't implemented.

Nick D
+1  A: 

Maybe you want to consider to just change the old style function signatures. There shouldn't be any issues with that.

EDIT:

For an automatic conversion of your source files from old style syntax to ANSI-C style, take a look at the cproto tool. Maybe that could save you some time if you decide to go that direction.

This is an excerpt from the docs:

-f n Set the style of generated function prototypes where n is a number from 0 to 3. For example, consider the function definition

main (argc, argv)
int argc;
char *argv[];
{
}

If the value is 0, then no prototypes are generated. When set to 1, the output is:

int main(/*int argc, char *argv[]*/);

For a value of 2, the output has the form:

int main(int /*argc*/, char */*argv*/[]);

The default value is 3. It produces the full function prototype:

int main(int argc, char *argv[]);
Frank Bollack
Unfortunately there are 45,000+ function declarations - so I was trying to avoid that if possible.
alan