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. Advertisements

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:
    3,170
    tom_usenet
    Aug 2, 2004
  2. Replies:
    1
    Views:
    467
  3. Paul F. Dietz

    Question about incomplete array element types

    Paul F. Dietz, Jul 11, 2003, in forum: C Programming
    Replies:
    5
    Views:
    671
    Dan Pop
    Jul 11, 2003
  4. Mantorok Redgormor

    lvalues -> incomplete types

    Mantorok Redgormor, Feb 6, 2004, in forum: C Programming
    Replies:
    7
    Views:
    624
  5. Michael Birkmose

    pointer to incomplete types

    Michael Birkmose, May 14, 2004, in forum: C Programming
    Replies:
    7
    Views:
    1,004
    Dave Thompson
    May 27, 2004
  6. friend.05
    Replies:
    0
    Views:
    389
    friend.05
    Nov 22, 2006
  7. friend.05
    Replies:
    8
    Views:
    850
    santosh
    Nov 22, 2006
  8. Andre
    Replies:
    5
    Views:
    806
    Keith Thompson
    Jul 17, 2012
Loading...