On Thu, Feb 13, 2003 at 09:49:39PM +1100, Darren Reed wrote:
> What were you doing to test this? I can check this for you on IRIX, if
> you'd like.
I was compiling the attached "foolib.c" and putting it into a shared
library, and then compiling the attached "foo.c", linking it with that
library, and running it. I then modified the string in "foolib.c",
rebuilt the shared library, and did *not* rebuild the program from
"foo.c" but just re-ran the program; it should print the new value of
the string.
static const char foostr[] = "Hi, honey, I'm home!";
const char *
foo(void)
{
return foostr;
}
#include <stdio.h>
extern const char *foo(void);
#if 0
extern char foostr[];
#endif
int
main(int argc, char **argv)
{
printf("%s\n", foo());
#if 0
printf("%s\n", foostr);
#endif
return 0;
}