LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 12-17-2023, 03:41 AM   #1
marijan
LQ Newbie
 
Registered: Aug 2013
Posts: 13

Rep: Reputation: Disabled
man pages declarations


Code:
void qsort(void base[.size * .nmemb], size_t nmemb, size_t size, int (*compar)(const void [.size], const void [.size]));
void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *));
The first line is delaclaration of qsort stdlib function in Debian.
The second line is from NetBSD. NetBSD looks like an old school.
I didn't notice when linux started with new declaration.
But I don't know why it is so? And where it is explained?
What are dots in .size and .nmemb?

Last edited by marijan; 12-17-2023 at 03:43 AM.
 
Old 12-17-2023, 08:16 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,360
Blog Entries: 28

Rep: Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148
You might start with man man.
 
Old 12-18-2023, 12:57 AM   #3
lvm_
Member
 
Registered: Jul 2020
Posts: 961

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
Just like all other files in FOSS projects, man pages are stored in publicly available version control systems where you can see change history for a file and, hopefully, comments giving reasons for changes. All you have to do is use your google-fu to locate it.
 
Old 12-18-2023, 02:58 AM   #4
marijan
LQ Newbie
 
Registered: Aug 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by lvm_ View Post
Just like all other files in FOSS projects, man pages are stored in publicly available version control systems where you can see change history for a file and, hopefully, comments giving reasons for changes. All you have to do is use your google-fu to locate it.
In other words, both of you have no slightest idea.
mam man is a universal poor ignorant answer, as well as whatever-fu. Thanks.
 
Old 12-18-2023, 03:47 AM   #5
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,849

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Like lvm_ wrote, the Linux man pages are in git. A handy web page: https://git.kernel.org/pub/scm/docs/...man-pages.git/. qsort.3 man page has seen these commits: https://git.kernel.org/pub/scm/docs/...g/man3/qsort.3 There is a commit 2022-11-10 'Various pages: SYNOPSIS: Use VLA syntax in 'void *' function parameters': https://git.kernel.org/pub/scm/docs/...8a640f034fea70

The explanation:
Code:
Use VLA syntax also for void *, even if it's a bit more weird.

Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2611.htm>
Cc: Ingo Schwarze <schwarze@openbsd.org>
Cc: JeanHeyd Meneide <wg14@soasis.org>
Cc: Martin Uecker <uecker@tugraz.at>
Cc: <gcc@gcc.gnu.org>
Signed-off-by: Alex Colomar <alx.manpages@gmail.com>
About the VLA syntax in the https link above:
Quote:
Additional Principle for C23
At the WG 14 meeting in London, England, in April, 2016, the previous principles were reviewed, and the following was added:

15. Application Programming Interfaces (APIs) should be self-documenting when possible. In particular, the order of parameters in function declarations should be arranged such that the size of an array appears before the array. The purpose is to allow Variable-Length Array (VLA) notation to be used. This not only makes the code's purpose clearer to human readers, but also makes static analysis easier. Any new APIs added to the Standard should take this into consideration.
 
Old 12-18-2023, 04:04 AM   #6
marijan
LQ Newbie
 
Registered: Aug 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Petri Kaukasoina View Post
Like lvm_ wrote, the Linux man pages are in git. A handy web page: https://git.kernel.org/pub/scm/docs/...man-pages.git/. qsort.3 man page has seen these commits: https://git.kernel.org/pub/scm/docs/...g/man3/qsort.3 There is a commit 2022-11-10 'Various pages: SYNOPSIS: Use VLA syntax in 'void *' function parameters': https://git.kernel.org/pub/scm/docs/...8a640f034fea70

The explanation:
Code:
Use VLA syntax also for void *, even if it's a bit more weird.

Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2611.htm>
Cc: Ingo Schwarze <schwarze@openbsd.org>
Cc: JeanHeyd Meneide <wg14@soasis.org>
Cc: Martin Uecker <uecker@tugraz.at>
Cc: <gcc@gcc.gnu.org>
Signed-off-by: Alex Colomar <alx.manpages@gmail.com>
About the VLA syntax in the https link above:
Thank You.
 
Old 12-19-2023, 12:45 AM   #7
lvm_
Member
 
Registered: Jul 2020
Posts: 961

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
Quote:
Originally Posted by marijan View Post
In other words, both of you have no slightest idea.
Try to teach a hungry man to fish, and as so often, he demonstrates his indolence in a rude manner. And someone meekly give him a fish...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
man not working if man pages are on NFS share ehereth Linux - Software 21 08-10-2018 02:06 PM
BLFS 8.1: OpenSP places man pages in usr/man jr_bob_dobbs Linux From Scratch 1 02-13-2018 07:23 PM
[SOLVED] man pages - man command phillyfilly Linux - Newbie 4 02-10-2014 05:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration