error prob

This is a discussion on error prob within the Linux Programming forums, part of the Platform Specific Boards category; I try turn the code into asm but i get this message. root.c: In function `main': root.c:6: warning: return type ...

  1. #1
    Registered User invisibleghost's Avatar
    Join Date
    Jun 2004
    Posts
    28

    error prob

    I try turn the code into asm but i get this message.




    root.c: In function `main':
    root.c:6: warning: return type of `main' is not `int'

  2. #2
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    Oooo post the asm... I like it.

    Make sure it's declared as global:

    Code:
    .globl _main   # AT&T (.s file)
    global _main   ; Intel (.asm file)
    *edit*

    You are talking about gcc -S <filename> right?
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  3. #3
    Registered User invisibleghost's Avatar
    Join Date
    Jun 2004
    Posts
    28
    Quote Originally Posted by ahluka
    Oooo post the asm... I like it.

    Make sure it's declared as global:

    Code:
    .globl _main   # AT&T (.s file)
    global _main   ; Intel (.asm file)
    *edit*

    You are talking about gcc -S <filename> right?



    yes i am talking about gcc-S <filename>

  4. #4
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    Hmm. Damn I'm thick - you can't post asm you don't have... sorry. I put it down to the air here and the shock of today (see ES).
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  5. #5
    Registered User invisibleghost's Avatar
    Join Date
    Jun 2004
    Posts
    28
    Quote Originally Posted by ahluka
    Hmm. Damn I'm thick - you can't post asm you don't have... sorry. I put it down to the air here and the shock of today (see ES).


    I just use cat root.s and it show the asm code silly me.

  6. #6
    B26354 Deckard's Avatar
    Join Date
    Jan 2002
    Posts
    633
    Perhaps you could post the source that gcc doesn't like. I suspect you've specified main with a return type of void.

    EDIT: Oops, problem solved a good ten minutes ago
    Jason Deckard

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21