From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21887 invoked by alias); 10 Dec 2010 23:45:54 -0000 Received: (qmail 21878 invoked by uid 22791); 10 Dec 2010 23:45:53 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_MM,TW_MV X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Dec 2010 23:45:48 +0000 From: "matt at use dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/46890] New: compile regression from 4.5 when building scummvm's player_v4a.cpp X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: matt at use dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 10 Dec 2010 23:45:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-12/txt/msg01157.txt.bz2 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: unassigned@gcc.gnu.org ReportedBy: matt@use.net using 4.6.0 20101206 (experimental) [trunk revision 167481]: building the open source project, scummvm (http://scummvm.org) trunk revision : 54858 matt@matt-desktop:~/src/scummvm$ CXX=/usr/lib/gcc-snapshot/bin/g++ ./configure --enable-all-engines [...] matt@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.