Skip to content

Instantly share code, notes, and snippets.

@arsenm
Last active December 13, 2015 23:09
Show Gist options
  • Save arsenm/4990124 to your computer and use it in GitHub Desktop.
Save arsenm/4990124 to your computer and use it in GitHub Desktop.
Initializer with address_space requires cv qualifier
// 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.
*/
@arsenm
Copy link
Author

arsenm commented Feb 19, 2013

This only happens in C++ mode. It compiles in C mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment