http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46890

           Summary: compile regression from 4.5 when building scummvm's
                    player_v4a.cpp
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: m...@use.net


using 4.6.0 20101206 (experimental) [trunk revision 167481]:

building the open source project, scummvm (http://scummvm.org) trunk revision :
54858
m...@matt-desktop:~/src/scummvm$ CXX=/usr/lib/gcc-snapshot/bin/g++ ./configure
--enable-all-engines
[...]
m...@matt-desktop:~/src/scummvm$ make
[...]
In file included from ./engines/scumm/player_v4a.h:32:0,
                 from engines/scumm/player_v4a.cpp:27:
./sound/mods/tfmx.h:115:2: error: expected ';' after struct definition
./sound/mods/tfmx.h:115:11: error: ISO C++ forbids declaration of '_resource'
with no type [-fpermissive]

[ ... and then several more compile errors that snowball from the first one ...
]

The code in question looks like this:


        struct MdatResource {
                const byte *mdatAlloc;  ///< allocated Block of Memory
                const byte *mdatData;   ///< Start of mdat-File, might point
before mdatAlloc to correct Offset
                uint32 mdatLen;

                uint16 headerFlags;
//              uint32 headerUnknown;
//              char textField[6 * 40];

                struct Subsong {
                        uint16 songstart;       ///< Index in Trackstep-Table
                        uint16 songend;         ///< Last index in
Trackstep-Table
                        uint16 tempo;
                } subsong[kNumSubsongs];

                uint32 trackstepOffset; ///< Offset in mdat
                uint32 sfxTableOffset;

                uint32 patternOffset[kMaxPatternOffsets];       ///< Offset in
mdat
                uint32 macroOffset[kMaxMacroOffsets];   ///< Offset in mdat

                void boundaryCheck(const void *address, size_t accessLen = 1)
const {
                        assert(mdatAlloc <= address && (const byte *)address +
accessLen <= (const byte *)mdatData + mdatLen);
                }
        } const *_resource;


Configuring with g++-4.5 (4.5.1-7ubuntu2) or g++-4.4 (Ubuntu/Linaro
4.4.4-14ubuntu5) fixes the compilation.

Reply via email to