Re: Compilation order



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
.