[Updated: 04/07/2006] Much accurate information is available in a better format at:
Reducing Symbol Scope with Sun Studio C/C++__________________
bpte4500s001:/sunbuild1/giri/testcases/symbol-hiding/%which CC
/sunbuild3/S1S9_0609/SUNWspro/bin/CC
bpte4500s001:/sunbuild1/giri/testcases/symbol-hiding/%CC -V
CC: Sun C++ 5.6 d-iteam 2004/06/09
bpte4500s001:/sunbuild1/giri/testcases/symbol-hiding/%ls -l
total 8
-rw-r--r-- 1 build engr 215 Sep 14 15:59 hidden.c
-rw-r--r-- 1 build engr 63 Sep 14 15:58 hidden.h
-rw-r--r-- 1 build engr 281 Sep 14 16:03 driver.c
bpte4500s001:/sunbuild1/giri/testcases/symbol-hiding/%cat hidden.h
char *lastname(char *);
int agefunc();
char firstchar(char *);
bpte4500s001:/sunbuild1/giri/testcases/symbol-hiding/%cat hidden.c
#include
#include "hidden.h"
int age = 25;
char *lastname(char *firstname)
{
return ((char *)"mandalika");
} //lastname
char firstchar(char *strings)
{
return (*strings);
} // firstchar
int agefunc()
{
age = 25;
return (age);
} // agefunc
bpte4500s001:/sunbuild1/giri/testcases/symbol-hiding/%cat driver.c
#include
#include "hidden.h"
int main()
{
char *lname, first;
int age = 0;
lname = lastname((char *)"Giri");
printf("\nlname = %s", lname);
age = agefunc();
printf("\nage = %d", age);
first = firstchar((char *)"chakry");
printf("\nfirst char = %c\n", first);
return (0);
} // main()