freestanding enviroment !

Discussion in 'C Programming' started by bhagatd@krify.com, Mar 16, 2006.

  1. Guest

    In freestanding environment name of the function called at program
    startup can be other than 'main' how it is specified?
     
    , Mar 16, 2006
    #1
    1. Advertising

  2. said:

    > In freestanding environment name of the function called at program
    > startup can be other than 'main' how it is specified?


    Each implementation used for such environments will provide this information
    in its documentation.

    --
    Richard Heathfield
    "Usenet is a strange place" - dmr 29/7/1999
    http://www.cpax.org.uk
    email: rjh at above domain (but drop the www, obviously)
     
    Richard Heathfield, Mar 16, 2006
    #2
    1. Advertising

  3. Richard Bos Guest

    wrote:

    > In freestanding environment name of the function called at program
    > startup can be other than 'main' how it is specified?


    You should be able to find such specifics in the implementation's
    manual. There's no other reliable way to tell.

    Richard
     
    Richard Bos, Mar 16, 2006
    #3
  4. On Thursday 16 March 2006 07:56, opined (in
    <>):

    > In freestanding environment name of the function called at program
    > startup can be other than 'main' how it is specified?


    It is up to the particular specification to specify it in any way it
    chooses (IMO, it may even specify that you are allowed to specify it
    through some documented mechanism). It has to be somewhere in your
    documentation.

    --
    BR, Vladimir

    Never argue with a fool -- people might not be able to tell the
    difference.
     
    Vladimir S. Oka, Mar 16, 2006
    #4
  5. writes:
    > In freestanding environment name of the function called at program
    > startup can be other than 'main' how it is specified?


    C99 5.1.2.1p1:

    In a freestanding environment (in which C program execution may
    take place without any benefit of an operating system), the name
    and type of the function called at program startup are
    implementation-defined.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Mar 16, 2006
    #5
  6. Charles Krug Guest

    On 2006-03-18, Thad Smith <> wrote:
    > wrote:
    >> In freestanding environment name of the function called at program
    >> startup can be other than 'main' how it is specified?

    >
    > As others have said it is implementation-defined. The most popular
    > choice seems to be
    >
    > void main(void);
    >
    > since there are no startup parameters and freestanding programs normally
    > don't exit.
    >


    My experience is that you call it whatever you wish, and have some
    platform-specific way of getting control transferred there.

    If you call it main() the compiler can complain if you declare it wrong,
    and folks here will do the same.
     
    Charles Krug, Mar 18, 2006
    #6
  7. Thad Smith Guest

    wrote:
    > In freestanding environment name of the function called at program
    > startup can be other than 'main' how it is specified?


    As others have said it is implementation-defined. The most popular
    choice seems to be

    void main(void);

    since there are no startup parameters and freestanding programs normally
    don't exit.

    --
    Thad
     
    Thad Smith, Mar 18, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bill Cunningham

    freestanding vs hosted implementations

    Bill Cunningham, Jul 5, 2003, in forum: C Programming
    Replies:
    5
    Views:
    430
    Morris Dovey
    Jul 6, 2003
  2. Vijay Kumar R Zanvar

    Freestanding Environment

    Vijay Kumar R Zanvar, Mar 3, 2004, in forum: C Programming
    Replies:
    19
    Views:
    758
    Keith Thompson
    Mar 5, 2004
  3. 50 SOMETHING GAL
    Replies:
    3
    Views:
    401
  4. J de Boyne Pollard

    Standard C library functions in freestanding systems

    J de Boyne Pollard, Sep 19, 2007, in forum: C Programming
    Replies:
    20
    Views:
    774
  5. J de Boyne Pollard

    Standard C library functions in freestanding systems

    J de Boyne Pollard, Sep 19, 2007, in forum: C Programming
    Replies:
    6
    Views:
    329
    Scott Lurndal
    Sep 21, 2007
Loading...

Share This Page