Debian Bug report logs - #199957
wgetn_wstr family wrong prototype

version graph

Package: libncursesw5-dev; Maintainer for libncursesw5-dev is Craig Small <csmall@debian.org>; Source for libncursesw5-dev is src:ncurses.

Reported by: Kai Henningsen <kai-debbugs@khms.westfalen.de>

Date: Fri, 4 Jul 2003 02:18:02 UTC

Severity: normal

Found in version 5.3.20030510-2

Done: Daniel Jacobowitz <dan@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, Daniel Jacobowitz <ncurses-maint@debian.org>:
Bug#199957; Package libncursesw5-dev. Full text and rfc822 format available.

Acknowledgement sent to Kai Henningsen <kai@khms.westfalen.de>:
New Bug report received and forwarded. Copy sent to Daniel Jacobowitz <ncurses-maint@debian.org>. Full text and rfc822 format available.

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

From: Kai Henningsen <kai@khms.westfalen.de>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: wgetn_wstr family wrong prototype
Date: Thu, 03 Jul 2003 22:31:00 +0200
Package: libncursesw5-dev
Version: 5.3.20030510-2
Severity: normal
File: /usr/include/ncursesw/curses.h

According to the Opengroup standard, these should be eclared as follows:
#include <curses.h>
int getn_wstr(wchar_t * wstr, int n);
int get_wstr(wchar_t * wstr);
int mvgetn_wstr(int y, int x, wchar_t * wstr, int n);
int mvget_wstr(int y, int x, wchar_t * wstr);
int mvwgetn_wstr(WINDOW * win, int y, int x, wchar_t * wstr, int n);
int mvwget_wstr(WINDOW * win, int y, int x, wchar_t * wstr);
int wgetn_wstr(WINDOW * win, wchar_t * wstr, int n);
int wget_wstr(WINDOW * win, wchar_t * wstr);

Specifically, they are supposed to take wchar_t *, not wint_t * as ncurses says.
(wint_t doesn't make sense here. These are simply wide variants of char *, while wint_t would be wide variants of int *!)

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux khms.westfalen.de 2.4.19+kai.58 #1 Sam Sep 7 14:16:44 CEST 2002 i686
Locale: LANG=de_DE, LC_CTYPE=de_DE

Versions of packages libncursesw5-dev depends on:
ii  libc6-dev [libc-dev]      2.3.1-16       GNU C Library: Development Librari
ii  libncursesw5              5.3.20030510-2 Shared libraries for terminal hand

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Jacobowitz <ncurses-maint@debian.org>:
Bug#199957; Package libncursesw5-dev. Full text and rfc822 format available.

Acknowledgement sent to dickey@herndon4.his.com:
Extra info received and forwarded to list. Copy sent to Daniel Jacobowitz <ncurses-maint@debian.org>. Full text and rfc822 format available.

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

From: Thomas Dickey <dickey@herndon4.his.com>
To: Kai Henningsen <kai@khms.westfalen.de>, 199957@bugs.debian.org
Cc: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Re: Bug#199957: wgetn_wstr family wrong prototype
Date: Fri, 4 Jul 2003 06:15:41 -0400
On Thu, Jul 03, 2003 at 10:31:00PM +0200, Kai Henningsen wrote:
> Package: libncursesw5-dev
> Version: 5.3.20030510-2
> Severity: normal
> File: /usr/include/ncursesw/curses.h
> 
> According to the Opengroup standard, these should be eclared as follows:
> #include <curses.h>
> int getn_wstr(wchar_t * wstr, int n);
> int get_wstr(wchar_t * wstr);
> int mvgetn_wstr(int y, int x, wchar_t * wstr, int n);
> int mvget_wstr(int y, int x, wchar_t * wstr);
> int mvwgetn_wstr(WINDOW * win, int y, int x, wchar_t * wstr, int n);
> int mvwget_wstr(WINDOW * win, int y, int x, wchar_t * wstr);
> int wgetn_wstr(WINDOW * win, wchar_t * wstr, int n);
> int wget_wstr(WINDOW * win, wchar_t * wstr);
> 
> Specifically, they are supposed to take wchar_t *, not wint_t * as ncurses says.
> (wint_t doesn't make sense here. These are simply wide variants of char *, while wint_t would be wide variants of int *!)

I suppose so - there are a number of typographical errors in the published
X/Open documentation, and I recall using Tru64's headers as a more accurate
reference.  Since these are the same size (for the platforms I know of), it's
likely that the wint_t was either leftover from the draft or introduced while
checking against Tru64's headers.

-- 
Thomas E. Dickey <dickey@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net



Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Jacobowitz <ncurses-maint@debian.org>:
Bug#199957; Package libncursesw5-dev. Full text and rfc822 format available.

Acknowledgement sent to dickey@herndon4.his.com:
Extra info received and forwarded to list. Copy sent to Daniel Jacobowitz <ncurses-maint@debian.org>. Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Jacobowitz <ncurses-maint@debian.org>:
Bug#199957; Package libncursesw5-dev. Full text and rfc822 format available.

Acknowledgement sent to dickey@herndon4.his.com:
Extra info received and forwarded to list. Copy sent to Daniel Jacobowitz <ncurses-maint@debian.org>. Full text and rfc822 format available.

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

From: Thomas Dickey <dickey@herndon4.his.com>
To: Kai Henningsen <kai@khms.westfalen.de>, 199957@bugs.debian.org
Subject: Re: Bug#199957: wgetn_wstr family wrong prototype
Date: Sat, 5 Jul 2003 06:52:09 -0400
On Thu, Jul 03, 2003 at 10:31:00PM +0200, Kai Henningsen wrote:
> Package: libncursesw5-dev
> Version: 5.3.20030510-2
> Severity: normal
> File: /usr/include/ncursesw/curses.h
> 
> According to the Opengroup standard, these should be eclared as follows:
> #include <curses.h>
...
> int wgetn_wstr(WINDOW * win, wchar_t * wstr, int n);
> int wget_wstr(WINDOW * win, wchar_t * wstr);
> 
> Specifically, they are supposed to take wchar_t *, not wint_t * as ncurses says.
> (wint_t doesn't make sense here. These are simply wide variants of char *, while wint_t would be wide variants of int *!)

checking further, I decided to not change this, since HPUX, Tru64 and Solaris
treat this as an error in X/Open's document.  Apparently the value is passed
for consistency with get_wch().  It was done this way in early drafts of
X/Open curses, and changed for the release.  However, since no one implements
it, there's no point in doing it that way.

-- 
Thomas E. Dickey <dickey@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net



Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Jacobowitz <ncurses-maint@debian.org>:
Bug#199957; Package libncursesw5-dev. Full text and rfc822 format available.

Acknowledgement sent to Kai Henningsen <kai@khms.westfalen.de>:
Extra info received and forwarded to list. Copy sent to Daniel Jacobowitz <ncurses-maint@debian.org>. Full text and rfc822 format available.

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

From: Kai Henningsen <kai@khms.westfalen.de>
To: Debian Bug Tracking System <199957@bugs.debian.org>
Subject: get*_wstr: seems I was wrong after all ...
Date: Sun, 06 Jul 2003 12:33:00 +0200
Package: libncursesw5-dev
Version: 5.3.20030510-2
Followup-For: Bug #199957

... though it's less than clear.

There's a corrigendum to c610.pdf, u058f.htm, which contains (among
other stuff) the following:

----------------------------------------------------------------------------

Change Number:  U018/1

On the getn_wstr() manual page (Page 96), replace the prototypes for
getn_wstr() and get_wstr() with:

  int getn_wstr(wint_t *wstr, int n);
  int get_wstr(wint_t *wstr);

Base Environment:
  System Interfaces and Headers, Issue 4, Version 2
  System Interfaces and Headers, Issue 5

-------------------------------------------------------------------------

No word on the other prototypes on the same page, but one assumes they
ought to be consistent. (And that it still ought to be applied for Issue
6 (aka POSIX 2001), by the way.)

When not even the corrigendum is correct ...

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux khms.westfalen.de 2.4.19+kai.58 #1 Sam Sep 7 14:16:44 CEST 2002 i686
Locale: LANG=de_DE, LC_CTYPE=de_DE

Versions of packages libncursesw5-dev depends on:
ii  libc6-dev [libc-dev]      2.3.1-16       GNU C Library: Development Librari
ii  libncursesw5              5.3.20030510-2 Shared libraries for terminal hand

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Daniel Jacobowitz <ncurses-maint@debian.org>:
Bug#199957; Package libncursesw5-dev. Full text and rfc822 format available.

Acknowledgement sent to dickey@herndon4.his.com:
Extra info received and forwarded to list. Copy sent to Daniel Jacobowitz <ncurses-maint@debian.org>. Full text and rfc822 format available.

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

From: Thomas Dickey <dickey@herndon4.his.com>
To: Kai Henningsen <kai@khms.westfalen.de>, 199957@bugs.debian.org
Subject: Re: Bug#199957: get*_wstr: seems I was wrong after all ...
Date: Sun, 6 Jul 2003 10:16:02 -0400
On Sun, Jul 06, 2003 at 12:33:00PM +0200, Kai Henningsen wrote:
> Package: libncursesw5-dev
> Version: 5.3.20030510-2
> Followup-For: Bug #199957
> 
> ... though it's less than clear.
> 
> There's a corrigendum to c610.pdf, u058f.htm, which contains (among
> other stuff) the following:

I hadn't noticed that one.  While I agree it's possible for
	sizeof(wint_t) > sizeof(wchar_t)
(which would be a problem), the other implementations do use wint_t,
so a cast is needed in practice for portability.
> 
> ----------------------------------------------------------------------------
> 
> Change Number:  U018/1
> 
> On the getn_wstr() manual page (Page 96), replace the prototypes for
> getn_wstr() and get_wstr() with:
> 
>   int getn_wstr(wint_t *wstr, int n);
>   int get_wstr(wint_t *wstr);
> 
> Base Environment:
>   System Interfaces and Headers, Issue 4, Version 2
>   System Interfaces and Headers, Issue 5
> 
> -------------------------------------------------------------------------
> 
> No word on the other prototypes on the same page, but one assumes they
> ought to be consistent. (And that it still ought to be applied for Issue
> 6 (aka POSIX 2001), by the way.)

I do recall fixing more than one thing.  What I did (this was late 1999
and early 2000), was to take the text from the X/Open document, extracting
the prototypes from the text.  I compiled that - found some inconsistencies
and typos, and then added the Tru64 header to the mix, and fixed a few
more things.  There were a couple of prototypes for which the compiler
didn't report an inconsistency, which were fixed later.  But (barring
a new revision which changes things), I think I got it done properly.
 
> When not even the corrigendum is correct ...

(my favorite is the tgetent note ;-)

-- 
Thomas E. Dickey <dickey@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net



Changed Bug submitter from Kai Henningsen <kai@khms.westfalen.de> to Kai Henningsen <kai-debbugs@khms.westfalen.de>. Request was from Kai Henningsen <kai-debbugs@khms.westfalen.de> to control@bugs.debian.org. Full text and rfc822 format available.

Reply sent to Daniel Jacobowitz <dan@debian.org>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Kai Henningsen <kai-debbugs@khms.westfalen.de>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #37 received at 199957-done@bugs.debian.org (full text, mbox):

From: Daniel Jacobowitz <dan@debian.org>
To: Kai Henningsen <kai@khms.westfalen.de>, 199957-done@bugs.debian.org
Subject: Re: Bug#199957: get*_wstr: seems I was wrong after all ...
Date: Sun, 20 Jul 2003 14:47:58 -0400
On Sun, Jul 06, 2003 at 12:33:00PM +0200, Kai Henningsen wrote:
> Package: libncursesw5-dev
> Version: 5.3.20030510-2
> Followup-For: Bug #199957
> 
> ... though it's less than clear.
> 
> There's a corrigendum to c610.pdf, u058f.htm, which contains (among
> other stuff) the following:
> 
> ----------------------------------------------------------------------------
> 
> Change Number:  U018/1
> 
> On the getn_wstr() manual page (Page 96), replace the prototypes for
> getn_wstr() and get_wstr() with:
> 
>   int getn_wstr(wint_t *wstr, int n);
>   int get_wstr(wint_t *wstr);
> 
> Base Environment:
>   System Interfaces and Headers, Issue 4, Version 2
>   System Interfaces and Headers, Issue 5
> 
> -------------------------------------------------------------------------
> 
> No word on the other prototypes on the same page, but one assumes they
> ought to be consistent. (And that it still ought to be applied for Issue
> 6 (aka POSIX 2001), by the way.)
> 
> When not even the corrigendum is correct ...

Since everyone seems satisfied with the current state of affairs, I'm
closing this bug report.  Thanks!

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 01:25:54 2014; Machine Name: buxtehude.debian.org

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