Consider the following:
Code: Select all
rumba-jj) cc/vers
VSI C x86-64 X7.4-843 (GEM 50XB9) on OpenVMS x86_64 V9.2-1
rumba-jj) ty test1.c
typedef int (*Algo)(int dstSize);
static int jj( int i )
{
return i;
}
static int jjj( int i )
{
return i;
}
int jj1( int i )
{
static const Algo decompress[2] = { jj, jjj};
return decompress[ i ](5);
}
8-DEC-2023 13:39:06
rumba-jj) ty test2.c
typedef int (*Algo)(int dstSize);
static int jj( int i )
{
return 7*i;
}
static int jjj( int i )
{
return 5*i;
}
int jj2( int i )
{
static const Algo decompress[2] = { jj, jjj};
return decompress[ i ](5);
}
8-DEC-2023 13:39:11
rumba-jj) cc test1.c
rumba-jj) cc test2.c
rumba-jj) lib/crea jj.olb test1.obj,test2.obj
%LIBRAR-E-DUPGLOBAL, global symbol jjj from file $DSTM:[JOUKJ.test.bugs.c.stat_g
lob]test2.OBJ;1 already in library $DSTM:[JOUKJ.test.bugs.c.stat_glob]jj.olb;1
jjj (and jj) is defined static but appears as a global symbol in the object file. (the list-file (if created) gives it as a static).
I did not see this problem with the previous C-compiler. Also on AXP & IA64 I do not see this.
It is definitely a feature (???) of the new C-compiler on X86 to place sometimes static symbols as global symbols in the object file.
regards
Jouk