I am working with a source base with a unclear for me rule on pointer types definition: using _PTR_ macro instead of *. So, all the function prototypes and typedefs look like:
extern FILE_PTR _io_fopen(const char _PTR_, const char _PTR_);
I wonder what could be the rationale behind this since for me this seems excessive.
EDIT
By the way, for double indirection I found:
_io_strtod(char _PTR_, char _PTR_ _PTR_);
It is possible that the definition is for compatibility with DOS.
The
far/nearkeywords allow pointers to address memory inside / outside the current segment, allowing programs to address more than 64 KiB of memory while still keeping the benefits of 16 bit pointers for faster code / less memory usage.It is more typical to exclude
*from the definition. For example, in LibPNG, you can see definitions like:On most platforms,
FARwill be#definedto nothing.Although DOS is long past, some modern embedded architectures have similar issues. For Harvard architecture processors, pointers to program and data memory must be accessed using different instructions, so they have different types. Other processors have different “data models”, and it is not uncommon to see special pointer types for pointers below 2^24, 2^16, or 2^8.