[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: global variables in shared libraries



also sprach Andrew Suffield <asuffield@debian.org> [2004.01.24.0330 +0100]:
> I have never seen or heard of a valid use of global variables that
> could not be done better without using globals. I don't know what
> you're thinking of for debugging, but for initialisation you
> either want __attribute__((constructor)), pthread_once(), or
> a combination of the two.

I like to control debugging with two variables: the FILE* to the
stream to which the debugging should be written, and a bitfield so
see what should be printed.

If you can think of a better way to do this than using globals, then
please share it with me!

Also, I have never seen __attributes__((constructor)) before. Could
you give me a pointer where I could get more information on this?

Thanks,

-- 
Please do not CC me when replying to lists; I read them!
 
 .''`.     martin f. krafft <madduck@debian.org>
: :'  :    proud Debian developer, admin, and user
`. `'`
  `-  Debian - when you have better things to do than fixing a system
 
Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver!

Attachment: signature.asc
Description: Digital signature


Reply to: