Debian Bug report logs - #606899
manpages-dev: btowc(3) suggests non-optimal replacement function

version graph

Package: manpages-dev; Maintainer for manpages-dev is Martin Schulze <joey@debian.org>; Source for manpages-dev is src:manpages.

Reported by: "brian m. carlson" <sandals@crustytoothpaste.net>

Date: Sun, 12 Dec 2010 20:39:02 UTC

Severity: minor

Tags: fixed-upstream, patch

Found in version manpages/3.27-1

Fixed in version manpages/3.35-0.1

Done: Simon Paillard <spaillard@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Martin Schulze <joey@debian.org>:
Bug#606899; Package manpages-dev. (Sun, 12 Dec 2010 20:39:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to "brian m. carlson" <sandals@crustytoothpaste.net>:
New Bug report received and forwarded. Copy sent to Martin Schulze <joey@debian.org>. (Sun, 12 Dec 2010 20:39:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: manpages-dev: btowc(3) suggests non-optimal replacement function
Date: Sun, 12 Dec 2010 20:36:24 +0000
[Message part 1 (text/plain, inline)]
Package: manpages-dev
Version: 3.27-1
Severity: minor
Tags: patch

btowc(3) says:

  This function should never be used.  It does not work for encodings
  which have state, and unnecessarily treats single bytes differently
  from multibyte sequences.  Use the function mbtowc() instead.

but mbtowc(3) says:

  The function mbrtowc(3) provides a better interface to the same
  functionality.

Obviously, btowc(3) should not suggest a non-optimal interface; it
should instead suggest mbrtowc.  This is also true for the pair wctob(3)
and wctomb(3).  A patch is attached to fix both manpages to suggest the
preferable functions.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.37-rc5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages manpages-dev depends on:
ii  manpages                      3.27-1     Manual pages about using a GNU/Lin

manpages-dev recommends no packages.

Versions of packages manpages-dev suggests:
ii  konqueror [man-browser]       4:4.4.5-1  advanced file manager, web browser
ii  man-db [man-browser]          2.5.7-7    on-line manual pager

-- no debconf information

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
[manpages.patch (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Martin Schulze <joey@debian.org>:
Bug#606899; Package manpages-dev. (Thu, 22 Sep 2011 04:42:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to mtk.manpages@gmail.com:
Extra info received and forwarded to list. Copy sent to Martin Schulze <joey@debian.org>. (Thu, 22 Sep 2011 04:42:03 GMT) Full text and rfc822 format available.

Message #10 received at 606899@bugs.debian.org (full text, mbox):

From: Michael Kerrisk <mtk.manpages@gmail.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>, 606899@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: Bug#606899: manpages-dev: btowc(3) suggests non-optimal replacement function
Date: Thu, 22 Sep 2011 06:38:17 +0200
tags 606899 fixed-upstream
thanks

On Sun, Dec 12, 2010 at 9:36 PM, brian m. carlson
<sandals@crustytoothpaste.net> wrote:
> Package: manpages-dev
> Version: 3.27-1
> Severity: minor
> Tags: patch
>
> btowc(3) says:
>
>  This function should never be used.  It does not work for encodings
>  which have state, and unnecessarily treats single bytes differently
>  from multibyte sequences.  Use the function mbtowc() instead.
>
> but mbtowc(3) says:
>
>  The function mbrtowc(3) provides a better interface to the same
>  functionality.
>
> Obviously, btowc(3) should not suggest a non-optimal interface; it
> should instead suggest mbrtowc.  This is also true for the pair wctob(3)
> and wctomb(3).  A patch is attached to fix both manpages to suggest the
> preferable functions.

Brian,

Thanks for this report. For upstream 3.34, I applied a somewhat
different patch, which probably will satisfy your concerns.

Cheers,

Michael

diff --git a/man3/btowc.3 b/man3/btowc.3
index dde646b..c3b49a1 100644
--- a/man3/btowc.3
+++ b/man3/btowc.3
@@ -58,9 +58,12 @@ This function should never be used.
 It does not work for encodings which have
 state, and unnecessarily treats single bytes differently from multibyte
 sequences.
-Use the function
-.BR mbtowc ()
+Use either
+.BR mbtowc (3)
+or the thread-safe
+.BR mbrtowc (3)
 instead.
 .SH "SEE ALSO"
 .BR mbtowc (3),
+.BR mbrtowc (3),
 .BR wctob (3)
diff --git a/man3/wctob.3 b/man3/wctob.3
index 59f5fcd..7f98786 100644
--- a/man3/wctob.3
+++ b/man3/wctob.3
@@ -56,6 +56,12 @@ distinguish single-byte and multibyte characters.
 Use the function
 .BR wctomb (3)
 instead.
+Use either
+.BR wctomb (3)
+or the thread-safe
+.BR wcrtomb (3)
+instead.
 .SH "SEE ALSO"
 .BR btowc (3),
+.BR wcrtomb (3),
 .BR wctomb (3)

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/




Added tag(s) fixed-upstream. Request was from Michael Kerrisk <mtk.manpages@gmail.com> to control@bugs.debian.org. (Thu, 22 Sep 2011 04:42:05 GMT) Full text and rfc822 format available.

Reply sent to Simon Paillard <spaillard@debian.org>:
You have taken responsibility. (Sun, 18 Dec 2011 22:36:05 GMT) Full text and rfc822 format available.

Notification sent to "brian m. carlson" <sandals@crustytoothpaste.net>:
Bug acknowledged by developer. (Sun, 18 Dec 2011 22:36:05 GMT) Full text and rfc822 format available.

Message #17 received at 606899-close@bugs.debian.org (full text, mbox):

From: Simon Paillard <spaillard@debian.org>
To: 606899-close@bugs.debian.org
Subject: Bug#606899: fixed in manpages 3.35-0.1
Date: Sun, 18 Dec 2011 22:34:41 +0000
Source: manpages
Source-Version: 3.35-0.1

We believe that the bug you reported is fixed in the latest version of
manpages, which is due to be installed in the Debian FTP archive:

manpages-dev_3.35-0.1_all.deb
  to main/m/manpages/manpages-dev_3.35-0.1_all.deb
manpages_3.35-0.1.diff.gz
  to main/m/manpages/manpages_3.35-0.1.diff.gz
manpages_3.35-0.1.dsc
  to main/m/manpages/manpages_3.35-0.1.dsc
manpages_3.35-0.1_all.deb
  to main/m/manpages/manpages_3.35-0.1_all.deb
manpages_3.35.orig.tar.gz
  to main/m/manpages/manpages_3.35.orig.tar.gz



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 606899@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Simon Paillard <spaillard@debian.org> (supplier of updated manpages 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@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 08 Dec 2011 22:30:21 +0100
Source: manpages
Binary: manpages manpages-dev
Architecture: source all
Version: 3.35-0.1
Distribution: unstable
Urgency: low
Maintainer: Martin Schulze <joey@debian.org>
Changed-By: Simon Paillard <spaillard@debian.org>
Description: 
 manpages   - Manual pages about using a GNU/Linux system
 manpages-dev - Manual pages about using GNU/Linux for development
Closes: 604044 606899 614021 625747 626387 627841 631216 636319 641513 650773
Changes: 
 manpages (3.35-0.1) unstable; urgency=low
 .
   * Non-maintainer upload.
   * debian/watch: new upstream url (due to kernel.org issues)
   * Imported Upstream version 3.35 (Closes: #650773):
     . new manpages: recvmmsg.2 rt_tgsigqueueinfo.2 setns.2 syncfs.2
       sigqueue.3 cciss.4 hpsa.4
     . btowc.3, wctob.3: Add pointers to better, thread-safe alternative
       functions (Closes: #606899)
     . capabilities.7: File capabilities no longer optional (Closes: #626387)
     . fflush.3: Fix wording error (Closes: #614021)
     . ipv6.7: Fix description of address notation (Closes: #604044)
     . malloc.3: Fix typo (Closes: #636319)
     . mlock.2: Clarify EINVAL error (Closes: #625747)
     . termios.3: Add documentation of _POSIX_VDISABLE (Closes: #627841)
     . timerfd_create.2: Note behavior when timerdfd_settime() old_value
       is NULL (Closes: #641513)
   * motd.tail.5: generated by bootmisc, motd.5: link is to /var/run/motd
     (Closes: 631216) - thanks to Regid Ichira
Checksums-Sha1: 
 be558cd07e9f51a4ffe775890979059b4902bc5d 1863 manpages_3.35-0.1.dsc
 db2fe88132d9e4f27ed808b413c7a9b3ce5afb56 1688867 manpages_3.35.orig.tar.gz
 07580925d9258b201afbd49e5e8a2edfcc833445 52244 manpages_3.35-0.1.diff.gz
 11b811c957db662f40e419341b58d8813f355a79 762646 manpages_3.35-0.1_all.deb
 5cc984799c9b70abe56f588ca0486498407e9022 1670580 manpages-dev_3.35-0.1_all.deb
Checksums-Sha256: 
 9642c773a65e8bcb41d13b6ba71d1bf037bff5d38d9b64002e0ec83e71c21d08 1863 manpages_3.35-0.1.dsc
 7ed4d47f976ef0da3e3d393b7fad3634a9a54c2007a3212c625d8bd00f583df4 1688867 manpages_3.35.orig.tar.gz
 f04baf8cbf13e626149e98c1b3b90d2c8895a5d33dfa4918faeff16e17fecb8e 52244 manpages_3.35-0.1.diff.gz
 4ce72364e91f4a2c0f17587231eb2349f52eacac26b4621a0ada5fad58942eca 762646 manpages_3.35-0.1_all.deb
 f62fbb5ea5b60549ad9797d74a288464e47cd3164e5dbd54a23abd0a81eb4741 1670580 manpages-dev_3.35-0.1_all.deb
Files: 
 449d5d44cdb7417b8da90a5de8c5eff6 1863 doc important manpages_3.35-0.1.dsc
 e41432ee35a49036bbaf8d4598506e9c 1688867 doc important manpages_3.35.orig.tar.gz
 1b915ccc8debec9e1dd38985bae72c53 52244 doc important manpages_3.35-0.1.diff.gz
 09d139f44f124e94534b1730752200ba 762646 doc important manpages_3.35-0.1_all.deb
 67fd83e43e99a17faadd8990cd2a0ffe 1670580 doc optional manpages-dev_3.35-0.1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBCAAGBQJO4S5sAAoJEN/3OMLRbPuiAYIP/2xIbVHD5G9P3lSxjSGthQdt
A9SNsdHlwfYOxvuQwRcwGRC4lsjDrEWzYOrE4JpUseY5ZxyK8O11ZDTBQphCvmXK
W2/x7K0I7Vypupq5E5Z+AE4RL0xCGysGscfJ0CQKnl5XH+n0MH604YG1B9zhpg2V
PuTeHXfZWLaeHqU1BlacB9wDowv873RXRoOSoxYofDRW8qn3/wq9/58D+a6C8SkS
XWaHER0+dghFT/p5aYtXsSPo+BGFHXuTqBSsKEV5stRwkuQ3yvqfEVuZ+aq57fnc
d2BYkeLERVBZTmMOQbEtAKhPWuEuMnoiyvb8Hign6IFsR9PSpPbtHYZUIf4eZ0CI
kKDKmBUwQmSaV+WIwf2M8HLp023vH0Pj98BoyDWeZwpvZQ0JVtOCTvRmYkJuoiN/
QxS+/pmBchpAlSA3KcFpdQIAg6CuTVfPi0I8CG2OVyY2809w4lPmOWvBh7iBt9F8
2JES9O1OLzulpC6dtMT5AISJDFkbmDCkDUleAyWG5KGLYBQk+hJvfjZ8BzxlCMpL
2arxcwuJ74cmzuwEHFXT+sj07jS8KsoECV8Ro8TW5RWyVDy/auRIScMgUMz4bucU
YvK6fAulAFDQSEfmsiD8VbQsVQEq5coSQ5wcN5MDhqkHOnbhJBaBBkuFVzNWqWen
imNP1vX0xpIQfwz3X62x
=5K9c
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Thu, 26 Jan 2012 07:41:23 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 11:29:43 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.