extern with incomplete types

J

John Temples

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top