Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated std::unary/binary_function #46

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

kannibalox
Copy link
Contributor

While building this on Arch, I received the following error:

src/rpc/parse_commands.cc:19:36: error: 'unary_function<char, bool>' is deprecated [-Werror,-Wdeprecated-declarations]                                                                
struct command_map_is_space : std::unary_function<char, bool> {                                                                                                                       
                                   ^                                                                                                                                                  
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/bits/stl_function.h:124:7: note: 'unary_function<char, bool>' has been explicitly marked deprecated here
    } _GLIBCXX11_DEPRECATED;                                                                                                                                                          
      ^                                                                                                                                                                               
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/x86_64-pc-linux-gnu/bits/c++config.h:103:32: note: expanded from macro '_GLIBCXX11_DEPRECATED'        
# define _GLIBCXX11_DEPRECATED _GLIBCXX_DEPRECATED                                                                                                                                    
                               ^                                                                                                                                                      
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.1.0/../../../../include/c++/12.1.0/x86_64-pc-linux-gnu/bits/c++config.h:94:46: note: expanded from macro '_GLIBCXX_DEPRECATED'           
# define _GLIBCXX_DEPRECATED __attribute__ ((__deprecated__))

From research, nothing inside rtorrent should require this base class, so I simply removed it. There's an associated PR for libtorrent here: jesec/libtorrent#8

@jesec jesec merged commit e9303f6 into jesec:master Jul 4, 2023
Elegant996 added a commit to Elegant996/rtorrent that referenced this pull request Jul 29, 2023
commit 199e8f8
Author: Aleksa Sarai <cyphar@cyphar.com>
Date:   Mon Jun 20 19:09:57 2022 +1000

    utils: lockfile: avoid stack overflow for lockfile buffer

    There appears to have been some change on openSUSE (likely some new
    hardening flags for builds, or some glibc hardening) such that incorrect
    buffer handling results in a segfault even if the buffer is never
    overflowed.

    Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>

commit e9303f6
Author: kannibalox <kannibalox@gmail.com>
Date:   Tue Jul 4 02:56:29 2023 -0400

    Remove deprecated std::unary/binary_function (jesec#46)

commit 7a3fc21
Author: kannibalox <kannibalox@gmail.com>
Date:   Tue Jul 4 02:55:42 2023 -0400

    option_parser: fix unqualified calls to std::move (jesec#59)

    https://reviews.llvm.org/rG70b1f6de539867353940d3dcb8b25786d5082d63

commit f9a875b
Author: Jesse Chan <jc@linux.com>
Date:   Mon Jul 3 16:13:23 2023 -0700

    download_store: ensure that session files land on the disk

    Currently, save() stores session to the disk by:

    - serialize to bencode and write to files with .new ext
    - validate the new files
    - rename new files, removing .new ext

    Technically, this is done to make sure that session files on the
    disk are always valid/uncorrupted. However, if catastrophic events
    happen during save(), such as system crash / power outage, the actual
    content of session files may not have been synced to the disk.

    To make things much worse, rename() is atomic. That means we discarded
    the previous session files without actually landing the new session files
    on the disk, and we got a bunch of empty session files to deal with.

    This commit adds a fsync step to ensure that session files land on the
    disk.
Elegant996 added a commit to Elegant996/rtorrent that referenced this pull request Jul 31, 2023
commit 199e8f8
Author: Aleksa Sarai <cyphar@cyphar.com>
Date:   Mon Jun 20 19:09:57 2022 +1000

    utils: lockfile: avoid stack overflow for lockfile buffer

    There appears to have been some change on openSUSE (likely some new
    hardening flags for builds, or some glibc hardening) such that incorrect
    buffer handling results in a segfault even if the buffer is never
    overflowed.

    Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>

commit e9303f6
Author: kannibalox <kannibalox@gmail.com>
Date:   Tue Jul 4 02:56:29 2023 -0400

    Remove deprecated std::unary/binary_function (jesec#46)

commit 7a3fc21
Author: kannibalox <kannibalox@gmail.com>
Date:   Tue Jul 4 02:55:42 2023 -0400

    option_parser: fix unqualified calls to std::move (jesec#59)

    https://reviews.llvm.org/rG70b1f6de539867353940d3dcb8b25786d5082d63

commit f9a875b
Author: Jesse Chan <jc@linux.com>
Date:   Mon Jul 3 16:13:23 2023 -0700

    download_store: ensure that session files land on the disk

    Currently, save() stores session to the disk by:

    - serialize to bencode and write to files with .new ext
    - validate the new files
    - rename new files, removing .new ext

    Technically, this is done to make sure that session files on the
    disk are always valid/uncorrupted. However, if catastrophic events
    happen during save(), such as system crash / power outage, the actual
    content of session files may not have been synced to the disk.

    To make things much worse, rename() is atomic. That means we discarded
    the previous session files without actually landing the new session files
    on the disk, and we got a bunch of empty session files to deal with.

    This commit adds a fsync step to ensure that session files land on the
    disk.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants