Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#281 additional function definition detected for each invocation

open
nobody
None
5
2010-07-12
2010-07-12
CCompletion
No

example1.c
// this file shows an example of weird Ctags 5.8 output; likely error; finds additional definitions for function SomeFunction

#include <stdio.h>

static void SomeFunction(int* i, char** strArrPatterns); // line 6, declaration

static void SomeFunction(int* i, char** strArrPatterns) // line 8, definition
{

}

int main(int argc, char** argv)
{
int* i;
SomeFunction(i, (char*[]){"*", NULL}); // this is detected as another function definition (line 16)
SomeFunction(i, (char*[]){"*", NULL}); // and this as yet another (line 17)
SomeFunction(i, ((char*[]){"*", NULL})); // this is OK (not detected as another definition), but the above code is correct as well
return 0;
}

// Ctags command line:
// ctags.exe --fields=-afiklmnSzt+sK --c-kinds=+lp --excmd=number -f ctags.tmp *
// the generated ctags.tmp file follows:
/*
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
SomeFunction example1.c 16;" function
SomeFunction example1.c 17;" function
SomeFunction example1.c 6;" prototype
SomeFunction example1.c 8;" function
i example1.c 15;" local
main example1.c 13;" function
*/

Discussion

  • CCompletion
    CCompletion
    2010-07-12

    source file with example and output

     
    Attachments