I've inherited a bit of code and saw something new. They have a data structure definition out in a .h file, and in various local files they'll declare:
union globalStructOstuff localVar;
Is there any merit to this?
I could see some if the global was some placeholder and the local versions were going to be different eventually. But that's not the case here.
So I think all it's doing is causing new guys a couple of extra minutes searching for definitions. I'd axe it once I got the chance, but I wanted to see if I'm missing some greater purpose.
With your fine help, I managed to open my eyes and realize globalStructOstuff isn't a struct at all, it's a union which holds the struct of a similar name. And they didn't use typedef. So all that's happening here is declaring a local variable. It has a type of union. No alias to anything global. Sorry for the confusion, thanks for all your help.