Community
Participate
Working Groups
Build Identifier: 20100917-0705 I'm using cdt 7 on helios on ubuntu 10.10. Also using the Linux toolchain (gcc, etc). Suppose I have some C code like the following (which I just made up for this example): int i = 5; float f = 5.0; char* message = "how arbitrary"; some_local_function(i, f, message); Is there some tool/function/magic that would generate the prototype for function 'some_local_function' from it's call site? In this case, I would get: void some_local_function(int i, float f, char* message) { // Add your code here } ... placed *above* the function that made the call. I couldn't find anything like this. I'm just doing it by hand. I can do this in Java with other IDEs (I think intellij idea 10 does it). Thanks. Reproducible: Always
(In reply to comment #0) > ... placed *above* the function that made the call. I think we have to distinguish between two use cases. 1) create a local function prototype (as suggested) 2) create a function prototype in another source file => - dialog to choose which source file - put prototype in the source file - put declaration in the corresponding header file - put an include statement in the original file
I think this sounds like one of quick fix proposals on the problem marker which would be currently generated by Codan in the place of unknown function call (at least in C++; in C calling an undefined function is legal AFAICR).