Date: Wed, 26 Feb 1997 21:27:47 +0900 (JST) From: Michael Hancock <michaelh@cet.co.jp> To: Zach Heilig <zach@blizzard.gaffaneys.com> Cc: Peter Haight <peterh@prognet.com>, freebsd-hackers@FreeBSD.org Subject: Re: Static variables in shared libraries Message-ID: <Pine.SV4.3.95.970226200732.23388A-100000@parkplace.cet.co.jp> In-Reply-To: <87rai36gyn.fsf@murkwood.gaffaneys.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 26 Feb 1997, Zach Heilig wrote: > >>>>> "Michael" == Michael Hancock <michaelh@cet.co.jp> writes: > > > Try news:comp.lang.c. "The C book" is also a necessity. > > You'll probably be flamed to hell and back there for posting about > unix-specific (or <anything>-specific) code, a better bet would be > news:comp.unix.programmer > > Of course they all will probably send you back over here, since you > are using FreeBSD :-) $ vi foo.c #include <stdio.h> const char* test_3 = "hello"; const char* test_4 = test_3; main() { printf("test_3 = %s\n", test_3); printf("test_4 = %s\n", test_4); return 0; } :wq $ lint foo.c (4) error: non-constant initializer: op "NAME" lint: errors in foo.c; no output created lint: pass2 not run - errors in foo.c Ok, this doesn't even compile. But if he's using auto-variables then the only thing I can think of is that the printf's are in his program while the variables are in the shared lib so he is trying to print something that's already been released and partially reused for something else. I could be wrong but it just smells more like a C problem than anything to do with the shared library facility. Regards, Mike "That's not a bug, that's a feature." ;-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SV4.3.95.970226200732.23388A-100000>