Skip to content

Qt4: a bug (?) in qbasictimer: error: expected unqualified-id before ')' token #145

@barracuda156

Description

@barracuda156

While suffering with attempts to fix blackomega ObjC++ sources to compile with gcc14, one of the persistent issues was the following:

In file included from /opt/local/include/qt4/QtCore/qtimer.h:47,
                 from /opt/local/include/qt4/QtCore/QTimer:1,
                 from /opt/local/var/macports/build/_opt_local_ppcports_audio_blackomega/blackomega/work/blackomega-2e5894f5c56621ead53ce68d9416042751e81b82/source/audioio/inc/AOBase.h:13,
                 from /opt/local/var/macports/build/_opt_local_ppcports_audio_blackomega/blackomega/work/blackomega-2e5894f5c56621ead53ce68d9416042751e81b82/source/audioio/inc/AOCoreAudio.h:12,
                 from /opt/local/var/macports/build/_opt_local_ppcports_audio_blackomega/blackomega/work/blackomega-2e5894f5c56621ead53ce68d9416042751e81b82/source/audioio/src/AOCoreAudio.mm:1:
/opt/local/include/qt4/QtCore/qbasictimer.h: In destructor 'QBasicTimer::~QBasicTimer()':
/opt/local/include/qt4/QtCore/qbasictimer.h:60:35: error: expected unqualified-id before ')' token
   60 |     inline ~QBasicTimer() { if (id) stop(); }
      |                                   ^
make[2]: *** [source/audioio/CMakeFiles/audioio.dir/src/AOCoreAudio.mm.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /opt/local/include/qt4/QtCore/qtimer.h:47,
                 from /opt/local/include/qt4/QtCore/QTimer:1,
                 from /opt/local/var/macports/build/_opt_local_ppcports_audio_blackomega/blackomega/work/blackomega-2e5894f5c56621ead53ce68d9416042751e81b82/source/remote/inc/RemoteIF.h:12,
                 from /opt/local/var/macports/build/_opt_local_ppcports_audio_blackomega/blackomega/work/blackomega-2e5894f5c56621ead53ce68d9416042751e81b82/source/remote/inc/AppleIRRemoteController.h:8,
                 from /opt/local/var/macports/build/_opt_local_ppcports_audio_blackomega/blackomega/work/blackomega-2e5894f5c56621ead53ce68d9416042751e81b82/source/remote/src/AppleIRRemoteController.mm:1:
/opt/local/include/qt4/QtCore/qbasictimer.h: In destructor 'QBasicTimer::~QBasicTimer()':
/opt/local/include/qt4/QtCore/qbasictimer.h:60:35: error: expected unqualified-id before ')' token
   60 |     inline ~QBasicTimer() { if (id) stop(); }
      |                                   ^
make[2]: *** [source/remote/CMakeFiles/remote.dir/src/AppleIRRemoteController.mm.o] Error 1

Modern gcc breaks down on this. It looks like this id is just locally defined in the header, and it does not need to be precisely id, which results in a conflict with the reserved keyword.
Can we patch it to be tid instead or w/e else, just not id?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions