#335171 glibc-doc: getsubopt() has different interface with #define _GNU_SOURCE

#335171#5
Date:
2005-10-22 09:11:27 UTC
From:
To:

#335171#10
Date:
2005-10-24 17:22:32 UTC
From:
To:
That's not what's going on.  Without -D_GNU_SOURCE you don't have a
prototype at all; GCC infers one.  Try using gcc -Wall to see what's
going on.

It'd be nice if the documentation said what #define you needed to use
this...

#335171#15
Date:
2005-10-25 09:20:56 UTC
From:
To:
Hello Daniel,

thanks for your prompt reply.

You are right concerning the missing prototype. But there is still a
problem with the documentation. That's what I get:

Compiling example from " 25.3.13 Parsing of Suboptions Example" as is:
     ginster:/home/werner/csource# gcc -Wall -o testprg testprg.c
     testprg.c: In function `main':
     testprg.c:47: warning: implicit declaration of function `getsubopt'
Just as you told. No prototype.

Adding "#define _GNU_SOURCE" in the first line:
ginster:/home/werner/csource# gcc -Wall -o testprg testprg.c
     testprg.c: In function `main':
     testprg.c:48: warning: passing arg 2 of `getsubopt'
                            from incompatible pointer type
The declaration of parameter 2 does not match the declaration of
getsubopt().

Removing "const" from the declaration of "mount_opts[]":
     ginster:/home/werner/csource# gcc -Wall -o testprg testprg.c
     ginster:/home/werner/csource#
No more warnings.

So my conclusion:
- The prototype is:
     int getsubopt (char **optionp, char* const *tokens, char **valuep);
   "const char* const *tokens" for the second argument seems to be an
   error in the documentation.
- In the example:
     "const char *mount_opts[] ="
   should be replaced by
     "char *mount_opts[] ="

Greetings
Werner

#335171#20
Date:
2026-07-29 19:33:29 UTC
From:
To:
Hello,

Bug #335171 in glibc-doc-reference reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/glibc-team/glibc-doc-reference/-/commit/ee1fef187595e605412b5a52c43b8b3f2d78e225

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/335171

#335171#27
Date:
2026-07-29 20:22:22 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
glibc-doc-reference, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 335171@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Aurelien Jarno <aurel32@debian.org> (supplier of updated glibc-doc-reference package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 29 Jul 2026 21:50:14 +0200
Source: glibc-doc-reference
Architecture: source
Version: 2.43-1
Distribution: unstable
Urgency: medium
Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Changed-By: Aurelien Jarno <aurel32@debian.org>
Closes: 335171 501435
Changes:
 glibc-doc-reference (2.43-1) unstable; urgency=medium
 .
   * New upstream version.  Closes: #335171, #501435.
   * debian/watch: update to v5 and use git instead of ftp.
   * debian/copyright: rewrite in Machine-readable format.
   * debian/rules: remove get-orig-source target and related code, now that the
     orig tarball can be generated with uscan.
   * debian/control: improve package description.
   * debian/control: drop Priority field, now the default.
   * debian/control: bump Standards-Version to 4.7.4 (no changes).
   * debian/salsa-ci.yml: add.
Checksums-Sha1:
 395cc60d24e44a3093f15cbf447ae42f52b55fca 2102 glibc-doc-reference_2.43-1.dsc
 f8865e2cc9224332a0925a6b45c8badb193b4082 761376 glibc-doc-reference_2.43.orig.tar.xz
 b19aaa469f5aa4ce548c77ed3bf9f2a2238f2612 6068 glibc-doc-reference_2.43-1.debian.tar.xz
 53278896a0db835bd6a65d663e701705987be8a0 5369 glibc-doc-reference_2.43-1_source.buildinfo
Checksums-Sha256:
 a664d227f56c0a7a4fc251774a9e981430f2cab03fd3227035822d6f208d763b 2102 glibc-doc-reference_2.43-1.dsc
 cb38f0725a853bea427cdcc97f870c27a1daac1f5f6ed9cabbb54f6aeb1f316b 761376 glibc-doc-reference_2.43.orig.tar.xz
 f2eb79851436d3f70ff015b22d74b1cfca23968b26285373fe77b480895b719c 6068 glibc-doc-reference_2.43-1.debian.tar.xz
 f7a409f1402dc01b10dd67ebeb435af34a25563b6f9e789cba266eba75d02739 5369 glibc-doc-reference_2.43-1_source.buildinfo
Files:
 e84efe9a345d389ee8104aabd8c53834 2102 non-free/doc optional glibc-doc-reference_2.43-1.dsc
 7a2720514399c842a3a4c39b1dde0d4d 761376 non-free/doc optional glibc-doc-reference_2.43.orig.tar.xz
 9835123765a2c7532ac7fa06cbc3cb63 6068 non-free/doc optional glibc-doc-reference_2.43-1.debian.tar.xz
 a4b78ba1812f5537b79926f3921ca4c4 5369 non-free/doc optional glibc-doc-reference_2.43-1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEUryGlb40+QrX1Ay4E4jA+JnoM2sFAmpqWnkACgkQE4jA+Jno
M2vErA/8CqriMyzmPpo24FTlM59mewUr4NtzQkwF1SvgP15b9TUBksL/uELIz2yZ
SY/wNiahMvxDNd+a6Hxqo19xwT6qpcEcQ04XPIL1/UR3flr6yQlZY367vnDKx/+C
+0sPbUihZYtZzn+RSOxwRV6xe21nOuvxyAExkLdrJrpmoU+W30pKl8fHDAJ4Gp3Y
tipC2hjhARpoGeuJpS0myfjCl2MIVyaKM3fOmjGXYvL0sbHL+DfmQHbaKvFFxa1h
1gWA3eN0Lp045+p96ZdCMuZZbF1XyEwIPHtOYfsn4HHCPgHPkfLX3WMZm3aKdvNB
IQckUe477bU9L0iaZ5yg8vMRf7fIqmK5WhvX44ZanbtkAxbmWlbtypWRC/2v7Xrr
sfCZDYn00y2GFoE5ejwjoly6vROnhST3udXFS/fGOTN9PvmKHXdgj+8quk4/wXNF
OQJKJKkvbkh8fD74FNk9Z05pc0KlFk7pMqFg/yMVZLyr/tte9F0eeG93f+v81pnz
2lvb7o1/QzbRx64BkWPzD45y+4ndXaJ4Yiua3NgIWAKxrGD8/FA5hylq71zTPh91
Jyc2SXbjUjD0VhNJIAuZdtAkoRC/9u6nJhZpgfDqrobOvIEz88iZz/gUTVc8F9u5
IO7t/K+/rJN2aKEx0d8nY/dWQMn1CZUgbCLtjnx2UvQ5+PDV7ZQ=
=k4jH
-----END PGP SIGNATURE-----