<br><br><div class="gmail_quote">On Mon, Jan 23, 2012 at 12:01 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Mon, Jan 23, 2012 at 11:02 AM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:<br>
> My previous change in include/llvm-c/Core.h that introduced 64-bit<br>
> Attributes (r148553) caused a warning<br>
> while building with MSVC. <a href="http://llvm.org/bugs/show_bug.cgi?id=11828" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=11828</a><br>
> The following patch fixes the problem (use "static const uint64_t" instead<br>
> of enum).<br>
> Ok to commit?<br>
><br>
> --kcc<br>
><br>
> Index: include/llvm-c/Core.h<br>
> ===================================================================<br>
> --- include/llvm-c/Core.h  (revision 148708)<br>
> +++ include/llvm-c/Core.h  (working copy)<br>
> @@ -92,7 +92,7 @@<br>
>  /** Used to get the users and usees of a Value. See the llvm::Use class. */<br>
>  typedef struct LLVMOpaqueUse *LLVMUseRef;<br>
><br>
> -typedef enum {<br>
> +static const uint64_t<br>
>      LLVMZExtAttribute       = 1<<0,<br>
>      LLVMSExtAttribute       = 1<<1,<br>
>      LLVMNoReturnAttribute   = 1<<2,<br>
> @@ -119,8 +119,8 @@<br>
>      LLVMReturnsTwice = 1 << 29,<br>
>      LLVMUWTable = 1 << 30,<br>
>      LLVMNonLazyBind = 1U << 31,<br>
> -    LLVMAddressSafety = 1ULL << 32<br>
> -} LLVMAttribute;<br>
> +    LLVMAddressSafety = 1ULL << 32;<br>
> +typedef uint64_t LLVMAttribute;<br>
><br>
>  typedef enum {<br>
>    /* Terminator Instructions */<br>
<br>
</div></div>Hmm... actually, I'm not sure this is okay; it's a<br>
non-binary-compatible change to the C API.<br></blockquote><div><br></div><div>Any other suggestion?</div><div>It's not easy to keep compatibility once the new (beyond 32-bits) attributes start getting used. </div><div>
Maybe add "enum LLVMAttribute2" for attributes in bits 33-64? </div><div><br></div><div>--kcc </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<span class="HOEnZb"><font color="#888888"><br>
-Eli<br>
</font></span></blockquote></div><br>