Re: Compilation order
- From: David Schwartz <davids@xxxxxxxxxxxxx>
- Date: Fri, 27 May 2011 12:23:57 -0700 (PDT)
On May 27, 5:56 am, w...@xxxxxxxxxxx wrote:
The array is file-scoped static.
The problem function is called from main and sees the array was
not initialized(all zero), so no dependency issue.
I couldn't replicate a simple example program to demonstrate.
So the claim "File-scope static arrays will always be initialised
before main()"
seems not true for me now. I want to know why?
There's a bug in your code. The most likely possibility is that some
object constructed before 'main' relies on some other object
constructed before 'main'.
DS
.
- Follow-Ups:
- Re: Compilation order
- From: wij
- Re: Compilation order
- References:
- Compilation order
- From: wij
- Re: Compilation order
- From: David Brown
- Re: Compilation order
- From: wij
- Compilation order
- Prev by Date: Re: Will it be possible one day to load and close dlls with static objects on UNIXs?
- Next by Date: Re: Compilation order
- Previous by thread: Re: Compilation order
- Next by thread: Re: Compilation order
- Index(es):
Relevant Pages
|