r/linuxadmin • u/musbur • Jun 07 '26
Linux man pages wrong?
I've had this happen on at least another manpage (that I forgot), but here it is with bsearch:
https://man7.org/linux/man-pages/man3/bsearch.3.html
void *bsearch(size_t n, size_t size;
const void key[size], const void base[size * n],
size_t n, size_t size,
typeof(int (const void [size], const void [size]))
*compar);The first two arguments are not supposed to be there (they come later). "man bsearch" on my Arch system shows the same output. What's going on here?
EDIT
chkno got it right: It's the semicolon at the end of the first line that makes the difference because otherwise the function prototype wouldn't know what "size" means in "const void key[size]" (second line).
Still learning new stuff after 45 years of mostly C89....
View all comments
Show parent comment
4
u/NotDG04 Jun 07 '26
I also had a similar case while looking at man page for one of the buffer string functions and was confused, until I figured that those are declarations and not arguments itself.