extern with incomplete types

Discussion in 'C Programming' started by John Temples, Nov 18, 2004.

  1. John Temples

    John Temples Guest

    Given this code appearing in this order in one file:

    typedef struct tag type;

    extern type var;

    struct tag { int i; };

    I have some compilers that give an error on the "extern" declaration,
    complaining that "tag" is incomplete or undefined, while some
    compilers accept this code. Which is the correct behavior?

    --
    John W. Temples, III
     
    John Temples, Nov 18, 2004
    #1
    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. Thomas Matthews
    Replies:
    5
    Views:
    2,548
    tom_usenet
    Aug 2, 2004
  2. Replies:
    1
    Views:
    373
  3. friend.05
    Replies:
    0
    Views:
    327
    friend.05
    Nov 22, 2006
  4. friend.05
    Replies:
    8
    Views:
    672
    santosh
    Nov 22, 2006
  5. Andre
    Replies:
    5
    Views:
    564
    Keith Thompson
    Jul 17, 2012
Loading...

Share This Page