Re: storage class static of functions

Discussion in 'C Programming' started by Willem, Jan 15, 2008.

  1. Willem

    Willem Guest

    asit wrote:
    ) Can functions have static storage clas ?? If yes, what is it's
    ) advantage ??

    No, functions can not have static storage class.


    SaSW, Willem
    --
    Disclaimer: I am in no way responsible for any of the statements
    made in the above text. For all I know I might be
    drugged or something..
    No I'm not paranoid. You all think I'm paranoid, don't you !
    #EOT
     
    Willem, Jan 15, 2008
    #1
    1. Advertising

  2. In article <>,
    Willem <> wrote:
    >asit wrote:
    >) Can functions have static storage clas ?? If yes, what is it's
    >) advantage ??


    >No, functions can not have static storage class.


    C89 3.7.1 Function Definitions
    [...]
    The storage-class specifier, if any, in the declaration specifiers
    shall be either extern or static.

    The same wording appears in N869 6.9.1 Function definitions
    --
    "Beware of bugs in the above code; I have only proved it correct,
    not tried it." -- Donald Knuth
     
    Walter Roberson, Jan 15, 2008
    #2
    1. Advertising

  3. Willem

    Chris Dollin Guest

    Willem wrote:

    > asit wrote:
    > ) Can functions have static storage clas ?? If yes, what is it's
    > ) advantage ??
    >
    > No, functions can not have static storage class.


    That's an interesting claim; to be clear, are you saying that

    static void nuffin(void) {}

    isn't legal, or are you saying that the notion of "storage class"
    appropriate to variables isn't applicable to functions?

    --
    Left Or Right? Hedgehog
    A rock is not a fact. A rock is a rock.
     
    Chris Dollin, Jan 15, 2008
    #3
    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. Patrick Hoffmann
    Replies:
    3
    Views:
    2,850
    Christian Jan├čen
    Aug 8, 2003
  2. sarathy
    Replies:
    2
    Views:
    676
    sarathy
    Jul 17, 2006
  3. Replies:
    5
    Views:
    411
  4. jacob navia

    Re: storage class static of functions

    jacob navia, Jan 15, 2008, in forum: C Programming
    Replies:
    2
    Views:
    284
    Chris Dollin
    Jan 15, 2008
  5. asit

    storage class static of functions

    asit, Jan 15, 2008, in forum: C Programming
    Replies:
    2
    Views:
    333
    Ravishankar S
    Jan 16, 2008
Loading...

Share This Page