Bug 271353 - multimedia/smpeg: fix build with clang 16
Summary: multimedia/smpeg: fix build with clang 16
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jose Alonso Cardenas Marquez
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-05-10 19:07 UTC by Dimitry Andric
Modified: 2023-05-18 11:44 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (acm)


Attachments
multimedia/smpeg: fix build with clang 16 (2.57 KB, patch)
2023-05-10 19:08 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2023-05-10 19:07:42 UTC
Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
Because multimedia/smpeg's configure scripts and Makefiles do not
explicitly set the C++ standard, this leads to several errors:

  In file included from MPEGaudio.cpp:24:
  ../MPEGaudio.h:129:7: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register int r=(buffer[bitindex>>3]>>(7-(bitindex&7)))&1;
        ^~~~~~~~~
  ../MPEGaudio.h:135:7: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register unsigned short a;
        ^~~~~~~~~
  MPEGaudio.cpp:317:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    register int r=(_buffer[bitindex>>3]>>(7-(bitindex&7)))&1;
    ^~~~~~~~~
  MPEGaudio.cpp:326:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    register unsigned short a;
    ^~~~~~~~~
  MPEGaudio.cpp:339:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    register unsigned short a;
    ^~~~~~~~~

Because smpeg uses a rather strange configure script, it does not
process CXXFLAGS correctly, so set CXX to include -std=gnu++98.

Also remove the REAL_CC patch which is no longer necessary.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-05-10 19:08:04 UTC
Created attachment 242110 [details]
multimedia/smpeg: fix build with clang 16
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-05-18 11:42:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=967c8049e17b6612c53b0232c8f19358ddd6a272

commit 967c8049e17b6612c53b0232c8f19358ddd6a272
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-10 19:02:32 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-18 11:34:31 +0000

    multimedia/smpeg: fix build with clang 16

    Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
    Because multimedia/smpeg's configure scripts and Makefiles do not
    explicitly set the C++ standard, this leads to several errors:

      In file included from MPEGaudio.cpp:24:
      ../MPEGaudio.h:129:7: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
            register int r=(buffer[bitindex>>3]>>(7-(bitindex&7)))&1;
            ^~~~~~~~~
      ../MPEGaudio.h:135:7: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
            register unsigned short a;
            ^~~~~~~~~
      MPEGaudio.cpp:317:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register int r=(_buffer[bitindex>>3]>>(7-(bitindex&7)))&1;
        ^~~~~~~~~
      MPEGaudio.cpp:326:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register unsigned short a;
        ^~~~~~~~~
      MPEGaudio.cpp:339:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register unsigned short a;
        ^~~~~~~~~

    Because smpeg uses a rather strange configure script, it does not
    process CXXFLAGS correctly, so set CXX to include -std=gnu++98.

    Also remove the REAL_CC patch which is no longer necessary.

    PR:             271353
    Approved by:    portmgr (build fix blanket)
    MFH:            2023Q2

 multimedia/smpeg/Makefile              | 4 ++--
 multimedia/smpeg/files/patch-configure | 8 --------
 2 files changed, 2 insertions(+), 10 deletions(-)