DECSET - SCA : issue with static C functions ?

Talk about commercial or opensource products that already exist for OpenVMS or may be available in the future.
Post Reply

Topic author
l.cedric
Active Contributor
Posts: 42
Joined: Thu Jul 18, 2019 8:18 am
Reputation: 0
Status: Offline

DECSET - SCA : issue with static C functions ?

Post by l.cedric » Wed Mar 23, 2022 12:03 pm

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 !

User avatar

arne_v
Valued Contributor
Posts: 67
Joined: Fri Apr 17, 2020 7:31 pm
Reputation: 0
Location: Rhode Island, USA
Status: Offline
Contact:

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

Post by arne_v » Thu Mar 24, 2022 9:42 pm

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 ()
{
}
Last edited by arne_v on Thu Mar 24, 2022 9:43 pm, edited 1 time in total.
Arne
arne@vajhoej.dk
VMS user since 1986


Topic author
l.cedric
Active Contributor
Posts: 42
Joined: Thu Jul 18, 2019 8:18 am
Reputation: 0
Status: Offline

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

Post by l.cedric » Fri Mar 25, 2022 5:28 am

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)

Post Reply