|
[Sponsors] |
Fixed staticinitorder bugs in getEnv and dotFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 7, 2009, 10:03 |
ulongIO.C has the same issue a
|
#21 |
Member
Michael Wild
Join Date: Mar 2009
Location: Bern, Switzerland
Posts: 79
Rep Power: 17 |
ulongIO.C has the same issue as uintIO.C. Here I would take a static_cast<unsigned>, because conversion operators are only defined for one-word types.
Michael |
|
January 8, 2009, 06:50 |
Henry
I think the init-orde
|
#22 |
Member
Michael Wild
Join Date: Mar 2009
Location: Bern, Switzerland
Posts: 79
Rep Power: 17 |
Henry
I think the init-order problem is much worse: Almost every class contains in it's implementation file a call to either defineTypeNameAndDebug which calls ::Foam::debug::debugSwitch, or it calls that function directly. Other candidates are ::Foam::debug::{info,optimisation}Switch. All of them call (indirectly) ::Foam::debug::switchSet, which in turn calls ::Foam::debug::controlDict, resulting in ::Foam::dotFoam being called, resulting in the same problem as discussed in above posts. I think you agree that moving all these static initializers into global.Cver is not an option, especially as it would make it impossible to add a new library later on, as that would require a change to global.Cver. I see these options:
IMHO, none of the options is very appealing... Michael |
|
January 8, 2009, 16:28 |
The ulong issue is now fixed i
|
#23 |
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 22 |
The ulong issue is now fixed in 1.5.x, thanks for the suggestion.
I will think about the debug switch initialization and get back to you. H |
|
January 9, 2009, 05:21 |
I don't suppose it would be an
|
#24 |
Member
Michael Wild
Join Date: Mar 2009
Location: Bern, Switzerland
Posts: 79
Rep Power: 17 |
I don't suppose it would be an option to get rid of all the static variables and replace them with "init on first use"? Probably would introduce quite some overhead, can't be inlined and Info() << "Hello\n" is just dead ugly
|
|
January 9, 2009, 05:24 |
It's an option but not a good
|
#25 |
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 22 |
It's an option but not a good option. I need time to think about it and play with some alternatives.
H |
|
January 9, 2009, 11:16 |
Is your original proposed chan
|
#26 |
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 22 |
Is your original proposed change to ::Foam::dotFoam sufficient to resolve the global construction order problems you are seeing? If so at this point I think it is the best of the options.
H |
|
January 9, 2009, 11:33 |
It solved it for me in the cur
|
#27 |
Member
Michael Wild
Join Date: Mar 2009
Location: Bern, Switzerland
Posts: 79
Rep Power: 17 |
It solved it for me in the current configuration. But similar issues might crop up anytime (e.g. compiler version changes etc.) However, I do agree that currently this is the easiest way out. Still I would like to see a more permanent solution to the whole issue...
Michael |
|
January 9, 2009, 11:37 |
If there are currently no othe
|
#28 |
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 22 |
If there are currently no other global construction order dependencies your solution should be general unless we add further globally constructed entities which depend on the current ones -- we should avoid this.
H |
|
January 10, 2009, 09:29 |
Thanks for every thing
|
#29 |
New Member
Mansuor Alghane
Join Date: Mar 2009
Location: Edinburgh, UK
Posts: 2
Rep Power: 0 |
Thanks for every thing
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bugs in fvcsurfaceIntegrate | su_junwei | OpenFOAM Bugs | 4 | July 7, 2013 11:29 |
Bugs in FFT | luca | OpenFOAM Bugs | 2 | January 27, 2009 16:40 |
15x readme txt file of fixed bugs | podallaire | OpenFOAM Bugs | 5 | October 2, 2008 09:50 |
Wiki - Bugs | Andy R | Main CFD Forum | 0 | July 25, 2008 14:15 |
bugs in starcd 4.06 | whitemelon | Siemens | 0 | July 11, 2008 07:26 |