Project

General

Profile

Actions

Bug #12164

closed

audio: definition of implicit copy constructor/operator is deprecated

Added by Toomas Soome almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Build errors with gcc 9:

    In file included from ../include/Audio.h:31,
                     from AudioCopy.cc:31:
    ../include/AudioError.h: In member function 'AudioError AudioError::operator=(AudioError)':
    ../include/AudioError.h:63:53: error: implicitly-declared 'constexpr AudioError::AudioError(const AudioError&)' is deprecated [-Werror=deprecated-copy]
       63 |      { code = val.code; sys = val.sys; return (*this); }
          |                                                     ^
    ../include/AudioError.h:62:20: note: because 'AudioError' has user-provided 'AudioError AudioError::operator=(AudioError)'
       62 |  inline AudioError operator = (AudioError val) // Assignment
          |                    ^~~~~~~~
    In file included from ../include/AudioStream.h:93,
                     from ../include/AudioBuffer.h:32,
                     from AudioCopy.cc:32:
    ../include/AudioStream_inline.h: In member function 'void AudioStream::setlength(Double)':
    ../include/AudioStream_inline.h:57:11: error: implicitly-declared 'constexpr Double& Double::operator=(const Double&)' is deprecated [-Werror=deprecated-copy]
       57 |  length = len;
          |           ^~~
    In file included from ../include/Audio.h:30,
                     from AudioCopy.cc:31:
    ../include/AudioTypes.h:139:2: note: because 'Double' has user-provided 'Double::Double(const Double&)'
      139 |  Double(const Double &x): val(x.val) { }
          |  ^~~~~~
    In file included from ../include/AudioStream.h:93,
                     from ../include/AudioBuffer.h:32,
                     from AudioCopy.cc:32:
    ../include/AudioStream_inline.h: In member function 'virtual void AudioStream::SetLength(Double)':
    ../include/AudioStream_inline.h:67:12: error: implicitly-declared 'constexpr Double& Double::operator=(const Double&)' is deprecated [-Werror=deprecated-copy]
       67 |   length = len;
          |            ^~~
    In file included from ../include/Audio.h:30,
                     from AudioCopy.cc:31:
    ../include/AudioTypes.h:139:2: note: because 'Double' has user-provided 'Double::Double(const Double&)'
      139 |  Double(const Double &x): val(x.val) { }
          |  ^~~~~~
    cc1plus: all warnings being treated as errors

The same issue as in 12139, we need to provide explicit definitions to prevent removal of implicit versions in future compiler versions.

Testing done: build/install/boot.

Actions #1

Updated by Toomas Soome almost 4 years ago

  • Description updated (diff)
Actions #2

Updated by Electric Monk almost 4 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 164ffd8939460c53fad1cb0c2a860ad54badd3e1

commit  164ffd8939460c53fad1cb0c2a860ad54badd3e1
Author: Toomas Soome <tsoome@me.com>
Date:   2020-01-13T15:47:13.000Z

    12164 audio: definition of implicit copy constructor/operator is deprecated
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Reviewed by: Matthias Scheler <mscheler@tintri.com>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF