On Mon, 26 May 2008 13:03:21 +0100 Nick Treleaven nick.treleaven@btinternet.com wrote:
On Sun, 25 May 2008 22:20:01 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
...
I started using the underscores because I thought this is common practise (at least I read a lot of code where underscores are used) and at some point there were problems if structs and types had the same name, so the easiest solution was to prefix the struct name with
Do you remember what problems there were?
Just to add info:
Although I haven't yet found a link to the relevant part of the ISO C90 standard, I've read elsewhere that struct names and typedef names have separate namespaces.
http://blogs.msdn.com/oldnewthing/archive/2008/03/26/8336829.aspx
So for new code (such as our API) it ought to be fine to use the same name for each. Also I'm pretty sure I'd done this a few times already when we got the portability patch and that didn't mention that it was an issue. I know that C99 adoption is not good, but C90 should be fine.
Regards, Nick