четверг, 3 февраля 2011 г.

О зарезервированных символах в POSIX (конкретно - о суффиксе _t в typedef'ах).
Имена типов, оканчивающиеся на _t, следует считать зарезервированными, т.к. в заголовочные файлы POSIX могут содержать произвольные объявления типов с таким именем.

http://stackoverflow.com/questions/231760/what-does-a-type-followed-by-t-underscore-t-represent

"However, you should also note that POSIX defines a lot of extra type names ending in '_t', and reserves the suffix for the implementation. That means that if you are working on POSIX-related systems, defining your own type names with the convention is ill-advised. The system I work on has done it (for more than 20 years); we regularly get tripped up by systems defining types with the same name as we define."

http://stackoverflow.com/questions/4336710/commonly-accepted-variable-name-formatting-c-c

"Also beware of using the '_t' suffix for type names, especially in a POSIX environment. Actually, the rules on the linked page are more extensive than the rules in the C99 standard, but one line says "ANY HEADER suffix '_t'". That means that if you include any POSIX header in a POSIX environment - remembering that is a POSIX header as well as a standard C header - then you should not have any typedefs which end in _t [...]"

http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
(таблица в пункте 2.2)