[llvm-commits] [compiler-rt] r82605 - /compiler-rt/trunk/BlocksRuntime/runtime.c

Daniel Dunbar daniel at zuster.org
Wed Sep 23 00:18:37 PDT 2009


Hi Edward,

On Tue, Sep 22, 2009 at 8:47 PM, Edward O'Callaghan
<eocallaghan at auroraux.org> wrote:
> Author: evocallaghan
> Date: Tue Sep 22 22:47:24 2009
> New Revision: 82605
>
> URL: http://llvm.org/viewvc/llvm-project?rev=82605&view=rev
> Log:
> Fix compile time warning: format '%#lx' expects type 'long unsigned int', but argument 3 has type 'unsigned int'

This isn't correct (of course, neither was the original). Argument 3
has type uintptr_t, which is not necessarily unsigned int. To be more
painfully portable it should probably always print as a uint64_t (I
confess to not looking at the context).

 - Daniel

>
> Modified:
>    compiler-rt/trunk/BlocksRuntime/runtime.c
>
> Modified: compiler-rt/trunk/BlocksRuntime/runtime.c
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/runtime.c?rev=82605&r1=82604&r2=82605&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/BlocksRuntime/runtime.c (original)
> +++ compiler-rt/trunk/BlocksRuntime/runtime.c Tue Sep 22 22:47:24 2009
> @@ -669,7 +669,7 @@
>         cp += sprintf(cp, " HASCTOR");
>     }
>     cp += sprintf(cp, "\nrefcount: %u\n", closure->flags & BLOCK_REFCOUNT_MASK);
> -    cp += sprintf(cp, "invoke: %#lx\n", (uintptr_t)closure->invoke);
> +    cp += sprintf(cp, "invoke: %#x\n", (uintptr_t)closure->invoke);
>     {
>         struct Block_descriptor *dp = closure->descriptor;
>         cp += sprintf(cp, "descriptor: %p\n", (void *)dp);
> @@ -677,8 +677,8 @@
>         cp += sprintf(cp, "descriptor->size: %lu\n", dp->size);
>
>         if (closure->flags & BLOCK_HAS_COPY_DISPOSE) {
> -            cp += sprintf(cp, "descriptor->copy helper: %#lx\n", (uintptr_t)dp->copy);
> -            cp += sprintf(cp, "descriptor->dispose helper: %#lx\n", (uintptr_t)dp->dispose);
> +            cp += sprintf(cp, "descriptor->copy helper: %#x\n", (uintptr_t)dp->copy);
> +            cp += sprintf(cp, "descriptor->dispose helper: %#x\n", (uintptr_t)dp->dispose);
>         }
>     }
>     return buffer;
> @@ -693,8 +693,8 @@
>     cp += sprintf(cp, "  flags: 0x%x\n", src->flags);
>     cp += sprintf(cp, "  size: %d\n", src->size);
>     if (src->flags & BLOCK_HAS_COPY_DISPOSE) {
> -        cp += sprintf(cp, "  copy helper: %#lx\n", (uintptr_t)src->byref_keep);
> -        cp += sprintf(cp, "  dispose helper: %#lx\n", (uintptr_t)src->byref_destroy);
> +        cp += sprintf(cp, "  copy helper: %#x\n", (uintptr_t)src->byref_keep);
> +        cp += sprintf(cp, "  dispose helper: %#x\n", (uintptr_t)src->byref_destroy);
>     }
>     return buffer;
>  }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list