Menu

#2 support for C++ ?

closed
None
5
2003-09-08
2003-08-20
No

What is the current level of support for C++? I tried
using cscope version 15.4 and noticed the following:
-) In the "global definition" field if a member function
name is specified, then the resulting listing gives the
function declaration instead of the definition, i.e., it
outputs the function signature in the class of which the
function is a member (typically in the .h file) as opposed
to the .c file?
-) If a member function takes any arguments, then
the "global definition" search on the function name
outputs nothing, i.e., it is unable to find even the
function declaration.

Am i doing something incorrect? are there any options
for C++ that i'm missing while building the database?

Is there any way to get cscope to work as effectively
for C++ as it does for C, or alternatively, is there any
better tool for C++?

Discussion

  • Hans-Bernhard Broeker

    Logged In: YES
    user_id=27517

    In a nutshell: the program's name is cscope, not c++scope,
    for a reason.

    1) Note that in C++, the definition for inline methods *is*
    inside the header file. Same for non-inlined methods of
    templated classes.

    2) Presence of arguments by itself shouldn't prevent
    detection of a function prototype --- please show a concrete
    examples.

    3) did you try searching for the method definition by it's
    actual name, i.e. classname::methodname?

     
  • Hans-Bernhard Broeker

    • assigned_to: nobody --> broeker
     
  • mohsin bhally

    mohsin bhally - 2003-09-07

    Logged In: YES
    user_id=846527

    thanks for the reply... i thought that by default the cscope
    command would include the .cpp files but i guess i was wrong!
    once the database was built ( only with the .h files), i was
    directed to the function declaration in the .h file!!
    after specifying .cpp while building the db everything seemed
    to be ok!
    However, classname::methodname is not recognized by
    cscope

     
  • mohsin bhally

    mohsin bhally - 2003-09-07

    Logged In: YES
    user_id=846527

    thanks for the reply... i thought that by default the cscope
    command would include the .cpp files but i guess i was wrong!
    once the database was built ( only with the .h files), i was
    directed to the function declaration in the .h file!!
    after specifying .cpp while building the db everything seemed
    to be ok!
    However, classname::methodname is not recognized by
    cscope

     
  • Hans-Bernhard Broeker

    • status: open --> closed