3 ms·
Are there any practical cases where you'd want "extern void foo"?
by ainar-g 4y ago
Are there any practical cases where you'd want "extern void foo"?
- veltas 4y agoYou could use it for getting an address that will be linked in later. On GCC I get a warning (which I don't think I can mask) for taking the address of such an object, because its expression is type void. A better way of achieving this is usually to declare something like extern unsigned char foo[] instead, but that has a type other than void*.