[llvmlinux] Multiple storage class error
Behan Webster
behanw at converseincode.com
Sat Nov 16 21:41:12 UTC 2013
On 11/16/13 05:38, Tinti wrote:
> Hi,
>
> I think we should change one of our patches to not use 'static
> register' as comment in this
> link http://www.lemoda.net/c/keywords/register.html and this
> one http://stackoverflow.com/questions/8674236/is-typedef-a-storage-class-specifier.
>
> /*
>
> * how to get the current stack pointer in C
>
> */
>
> #if defined(CONFIG_BUILTIN_STACK_POINTER)
>
> /* compiler has __builtin_stack_pointer support already */
>
>
>
> #elif defined(__clang__)
>
> #define __builtin_stack_pointer() ({ \
>
> unsigned long current_sp; \
>
> asm ("mov %0, sp" : "=r" (current_sp)); \
>
> current_sp; \
>
> })
>
> #define current_stack_pointer __builtin_stack_pointer()
>
>
>
> #else /* gcc */
>
> static register unsigned long current_stack_pointer asm ("sp");
> <==================
> #define __builtin_stack_pointer() current_stack_pointer
>
> #endif
>
> If we do so, we get kernel-gcc back to work on vexpress. What do you
> think?
>
Yeah. The static should be removed. I can't remember where I copied that
from in the kernel, but it's not there anymore.
Behan
--
Behan Webster
behanw at converseincode.com
More information about the LLVMLinux
mailing list