I\'m somewhere on the learning curve when it comes to regular expressions, and I need to use them to automatically modify function prototypes in a bunch of C headers. Does
For a one-off exercise, you'd probably do best by starting simple and looking at the code you have to scan. Pick the three worst headers, generate a regex or series of regexes that do the job. You have to decide whether and how you are going deal with comments that contain function declarations (and, indeed, with function declarations that contain comments). Dealing with:
extern void (*function(int, void (*)(int)))(int);
(which could be the Standard C function signal()) is tough in a regex because of the nested parentheses. If you don't have any such function prototypes, time spent working out how to deal with them is time wasted. Similar comments apply to pointers to multi-dimensional arrays. The chances are that you have stylistic conventions to simplify your life. You may not use C99 (C++) comments; you don't need to code around them. You probably don't put multiple declarations in a single line, either with or without a common type - so you don't have to deal with that.
extern int func1(int), func2(double); double func3(int); // Nasty!