3 ms·
I wasn't aware of that last point. Is this the answer why we have uniquely prefixed struct members in POSIX? Such as st_* in struct stat or d_* in struct dirent
by raimue 11y ago
I wasn't aware of that last point. Is this the answer why we have uniquely prefixed struct members in POSIX? Such as st_* in struct stat or d_* in struct dirent? Is that just a coincidence?
- dfox 11y agoAnother thing that it allows you is to #define "structure member" to be something more complex, for example on Linux you get st_atime (as in struct stat) #defined to st_atim.tv_sec (and so on for ctime, mtime, st_a/c/mtim is struct timespec, with nanosecond precision).
- _kst_ 11y agoYes, that's why member functions tend to have unique prefixes.
- breadbox 11y agoI don't think so. I'm going from memory here, but I think in pre-K&R C it wasn't assumed that every struct/union would be given its own separate namespace.
- tedunangst 11y agoThat also makes grepping for all occurrences of "flags" more useful, when it's p_flags or d_flags.