Skip to content

register keyword removed from C++17 #23

@tonycoz

Description

@tonycoz

(Same as pmqs/Compress-Raw-Bzip2#11 )

As you know we build blead perl using C++, but some modern C++ compilers that default to C++17 report an error for the register keyword:

 c++ -DNO_MATHOMS -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Werror=pointer-arith -Werror=vla -Wextra -Wno-long-long -Wno-declaration-after-statement -Wc++-compat -Wwrite-strings -O2   -DVERSION=\"2.204\" -DXS_VERSION=\"2.204\" -fPIC "-I../.."  -DBZ_NO_STDIO  compress.c
compress.c:190:13: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
            register UChar  rtmp;
            ^~~~~~~~~

This can be fixed by simply removing "register" and if you like I can supply a PR doing that, but that will also increase the distance between your zlib source and the upstream zlib source, you might prefer to add:

#define register

at the top of deflate.c and trees.c instead.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions