<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 23, 2010, at 9:04 AM, Helge Rhodin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div>
<!-- Converted from text/plain format --><p><font size="2">Hi,<br>
<br>
I have a problem with clang and the address space attribute. I don't know if it is intended or a bug. The following code compiles fine as a .c file but fails as .cpp:<br>
<br>
C-Code:<br>
int __attribute__((address_space(1))) globalint = 10;<br>
<br>
bitcode:<br>
@globalint = addrspace(1) global i32 10, align 4  ; <i32 addrspace(1)*> [#uses=0]<br>
<br>
Error in clangtest.cpp:<br>
clangtest.cpp:2:39: error: cannot initialize a variable of type 'int<br>
      __attribute__((address_space(1)))' with an rvalue of type 'int'<br>
int __attribute__((address_space(1))) globalint = 10;<br>
                                      ^           ~~<br>
1 error generated.<br></font></p></div></blockquote><div>That's definitely a bug. Please file a bug at <a href="http://llvm.org">llvm.org</a>, or (better yet!) provide a patch.</div><blockquote type="cite"><div><p><font size="2">
I have additional problems with classes. In which cases are none zero address spaces supported, is there a documentation around?<br></font></p></div></blockquote><div>Not much. Address spaces are described in the Embedded C TR; the draft of that TR (which has since been published) is available at <a href="http://www.open-std.org/jtc1/sc22/wg14/www/projects">http://www.open-std.org/jtc1/sc22/wg14/www/projects</a>.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">  </span>- Doug</div><div><br></div></div></body></html>