Last active
December 13, 2015 23:09
-
-
Save arsenm/4990124 to your computer and use it in GitHub Desktop.
Initializer with address_space requires cv qualifier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// No error | |
__attribute__((address_space(42))) | |
const float withc = 1.0f; | |
// No error | |
__attribute__((address_space(42))) | |
volatile float withv = 1.0f; | |
// Error | |
__attribute__((address_space(42))) | |
float nocv = 1.0f; | |
/* | |
as_initializer.cpp:12:7: error: cannot initialize a variable of type | |
'__attribute__((address_space(42))) float' with an rvalue of type 'float' | |
float nocv = 1.0f; | |
^ ~~~~ | |
1 error generated. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This only happens in C++ mode. It compiles in C mode.