Here is an example for what I mean:
int open(const char *pathname, int flags);
and from the man page. Looking into Linux, it is obvious the flags are bit markers.
I am curious by the use of an int
as a way to set specific bits, as I had thought that the most "portable" and recommended way to do this is to use an unsigned int
of specific size, perhaps uint32_t
.
Does anyone have any insight as to why this is? This is a purely educational question and I am asking out of curiosity.