Author Topic: Problem finding 'C' static function declarations/definitions with <Ctrl>+.  (Read 1978 times)

Scotty

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
<Ctrl>+. (with the cursor at the function definition) does not find the corresponding function declaration for a 'C' static function declared in a separate header file.
<Ctrl>+. does find the same static declaration correctly if it is located in the same file as the function definition.
There is no problem finding the declaration in the separate file if the function is not declared as static. Using the Symbols tab to find the static declaration/definition works fine, which says the tags are good.

example:

my_func.h
static int my_func(int my_arg);

my_func.c
static int my_func(int my_arg)
{
   int status = 0;
   return status;
}

Using SlickEdit Version 13.0.1.0

Graeme

  • Senior Community Member
  • Posts: 2357
  • Hero Points: 309
It makes no sense to have the declaration of a static function in a header file because it has internal linkage, meaning that the declaration refers to a different function in every translation unit that includes that header file.  Translation units that don't include a definition of that function have no reason to include the declaration.

Graeme