#3021 closed defect (fixed)
MSVC71 BUILD: Latest SVN doesn't compile
Reported by: | SF/josemuk | Owned by: | lordhoto |
---|---|---|---|
Priority: | normal | Component: | Port: Win32 |
Version: | Keywords: | ||
Cc: | Game: |
Description
Compiling with Microsoft Visual Studio 2003 I get a lot of errors like this with different engines (saga, agi, cine, kyra, agos, etc):
sagagame.cpp(576) : error C2073: 'Common::ADGameDescription::filesDescriptions' : elements of partially initialized array must have a default constructor
sagagame.cpp(576) : error C2512: 'Common::ADGameFileDescription' : no appropriate default constructor available
agosgame.cpp(12) : error C2073: 'Common::ADGameDescription::filesDescriptions' : elements of partially initialized array must have a default constructor
agosgame.cpp(12) : error C2512: 'Common::ADGameFileDescription' : no appropriate default constructor available
I suppose is due to the changes added recently to the game detector engine (3 days ago compiled fine)
Ticket imported from: #1645653. Ticket imported from: bugs/3021.
Attachments (1)
Change History (9)
comment:1 by , 18 years ago
Owner: | set to |
---|
comment:2 by , 18 years ago
by , 18 years ago
Attachment: | advdetector_no_const.diff added |
---|
comment:3 by , 18 years ago
Not sure about other compilers, but under gcc3, I get warnings in that part of code too.
Johannes, your solution seems good. But let me suggest another one : maybe simply remove the const qualifiers in ADGameFileDescription, ADGameDescription as the attached patch does. Since the detection data structures in the engines are always declared with the "const" keyword (gameDescriptions, detectionParams, it seems redundant to have them here too.
File Added: advdetector_no_const.diff
comment:4 by , 18 years ago
With cyx's patch, compiling with Visual Studio is working again. Many thanks!
comment:5 by , 18 years ago
Yeah Gregory's solution is much simpler and since, as he stated, we use const in the detection structures it shouldn't hurt.
comment:6 by , 18 years ago
Owner: | changed from | to
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:7 by , 18 years ago
I committed Gregory's patch now, if anybody has any objections it should be easy to revert.
I'm also assign it to myself since I committed it (I hope that's alright...)
comment:8 by , 6 years ago
Component: | --Unset-- → Port: Win32 |
---|
From what I understand the problem is that we initialize in most (maybe all?) cases less than 14 entries of ADGameDescription::filesDescriptions, now we need an default constructor for this, but if we add one braced initializing would be broken (at least for gcc), a possible fix would be something like I did here: http://svn.sourceforge.net/viewvc/scummvm?view=rev&revision=23518 (even though that was because of another reason, iirc). I don't know if that's something we want, since we use everywhere braced initializers for arrays.