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

Variable name "register" causes compiler error on C++17 #84

Closed
mgeier opened this issue Jan 18, 2019 · 0 comments · Fixed by jackaudio/headers#10
Closed

Variable name "register" causes compiler error on C++17 #84

mgeier opened this issue Jan 18, 2019 · 0 comments · Fixed by jackaudio/headers#10

Comments

@mgeier
Copy link

mgeier commented Jan 18, 2019

On Travis-CI, using Xcode-10.1 with Apple LLVM version 10.0.0 (clang-1000.11.45.5), I get the compile error:

/usr/local/Cellar/jack/0.125.0_3/include/jack/types.h:389:71: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int register, void *arg);
                                                                      ^~~~~~~~
/usr/local/Cellar/jack/0.125.0_3/include/jack/types.h:411:70: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
typedef void (*JackClientRegistrationCallback)(const char* name, int register, void *arg);
                                                                     ^~~~~~~~

The reason seems to be that the register storage class specifier has been removed in C++17, see https://en.cppreference.com/w/cpp/language/storage_duration.

JACK1 doesn't really want to use that anyway, but it tries to use register as a variable name, which causes the error.

This happens in the file types.h in https://github.com/jackaudio/headers, which is included as a submodule in this repo.

typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int register, void *arg);
typedef void (*JackClientRegistrationCallback)(const char* name, int register, void *arg);

It can even be seen in the syntax highlighting that register is somehow special ...

JACK2 already took care of this problem in https://github.com/jackaudio/jack2/blob/master/common/jack/types.h:

typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int /* register */, void *arg);
typedef void (*JackClientRegistrationCallback)(const char* name, int /* register */, void *arg);
mgeier added a commit to mgeier/headers that referenced this issue Nov 27, 2020
falkTX pushed a commit to jackaudio/headers that referenced this issue Nov 27, 2020
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 a pull request may close this issue.

1 participant