Page 1 of 1

DECSET - SCA : issue with static C functions ?

Posted: Wed Mar 23, 2022 12:03 pm
by l.cedric
Hello,

since few days, i've tried to see if SCA could be useful for our team. I've tried the tutorial and read the documentation, and i've succeded in some queries ... except the ones which search for static C functions.
I think it should be a bug, because it works for variables (for examples) but not for functions ... :?

Despite SCA official documentation :
a C static declaration creates a symbol that has a module-specific symbol domain
And I don't see any limitations regarding the functions ... which are symbols too :?:

Excerpt from the source code:

Code: Select all

$search sca$example:type_example.c static
static void routine1 () ;
static void routine2 () ;
So the first query below should display these 2 routines, and the second should display another one ...
Which is not the case at all :!:

And the queries to reproduce this issue:

Code: Select all

$sca find in (type_example and occurrence=compilation_unit, symbol=function and occurrence=primary and domain=module_specific)
%SCA-W-NOOCCUR, no symbol occurrence matches your selection criteria

$sca find in (type_example and occurrence=compilation_unit, symbol=function and occurrence=primary and domain=global)
routine1 procedure
    TYPE_EXAMPLE\138     void function definition declaration
routine2 procedure
    TYPE_EXAMPLE\144     void function definition declaration
type_example procedure
    TYPE_EXAMPLE\108     void function definition declaration
And moreover, the same issue with the DecWindows interface, which give us a clue => Domain's routines is "Global" despiste their static definitions :!: :?:
SCA_DecWindows.jpg

If needed, some informations about our system :

Code: Select all

$ product show product openvms
------------------------------------ ----------- ---------
PRODUCT                              KIT TYPE    STATE
------------------------------------ ----------- ---------
HP I64VMS OPENVMS V8.4               Platform    Installed
------------------------------------ ----------- ---------

$ sca sho version
%SCA-S-VERSION, this is SCA version V5.1-01
Anyone have any ideas on a solution or workaround ?
Thanks for any help !

Re: DECSET - SCA : issue with static C functions ?

Posted: Thu Mar 24, 2022 9:42 pm
by arne_v
Does SCA behave as expected if the actual implementation is declared static?

Aka:

static void routine1 () ;
...
static void routine1 ()
{
}

and not:

static void routine1 () ;
...
void routine1 ()
{
}

Re: DECSET - SCA : issue with static C functions ?

Posted: Fri Mar 25, 2022 5:28 am
by l.cedric
Unfortunately no :(
I tried that too, with this very simple code:

Code: Select all

$type very_simple_static.c
static void very_simple_static_routine ( void ) {}

$cc/ana very_simple_static.c

$sca load very_simple_static.ana
%SCA-S-LOADED, module VERY_SIMPLE_STATIC loaded
%SCA-S-COUNT, 1 module loaded (1 new, 0 replaced)
Still "global" as you can see:

Code: Select all

$sca find in (very_simple_static and occurrence=compilation_unit, domain=module_specific)
%SCA-W-NOOCCUR, no symbol occurrence matches your selection criteria

$sca find in (very_simple_static and occurrence=compilation_unit, domain=global)
very_simple_static_routine procedure
    VERY_SIMPLE_STATIC\1 void function definition declaration
%SCA-S-OCCURS, 1 occurrence found (1 symbol, 1 name)