lkml.org 
[lkml]   [2011]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][rfc] Use int as return type of main in arch/x86/boot/main.c
On 03/14/2011 12:03 PM, Steven Rostedt wrote:
> On Sun, Mar 13, 2011 at 11:00:09PM +0100, Jesper Juhl wrote:
>> I believe the return type of main should always be 'int'.
>
> But this is not userspace, it is called from assmebly in header.S:
>
> # Jump to C code (should not return)
> calll main
>
> We don't care what main returns. If it does return anything, then it
> dies:
>
> # Setup corrupt somehow...
> setup_bad:
> movl $setup_corrupt, %eax
> calll puts
> # Fall through...
>
> .globl die
> .type die, @function
> die:
> hlt
> jmp die
>

Yes, but some versions of gcc complains about a nonstandard signature to
main(). At least that's what I assume Jesper's issue was.

-hpa


\
 
 \ /
  Last update: 2011-03-14 23:53    [from the cache]
©2003-2011 Jasper Spaans