Re: Reasonable static initialization assurance

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

 



Hi Corey,

> Is there any way to ensure a static variable in file.b is initialized before
being used?

Yes, but you'll have to refactor your code a bit.

Use a static function in FileB to return FileB's static data (which is
static data inside that static function).

Have FileA get to the FileB's static data through that accessor function.

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux