bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UTF-8 output via "echo_wchar" resulting in errno=1 on Mac OS X


From: Thomas Dickey
Subject: Re: UTF-8 output via "echo_wchar" resulting in errno=1 on Mac OS X
Date: Tue, 19 Apr 2011 16:55:05 -0400 (EDT)

On Tue, 19 Apr 2011, Clemens Ladisch wrote:

Christoph Ender wrote:
I've noticed that output of non-ASCII chars using a self-compiled ncurses 5.9 
(the only
compile-option being --enable-widec) or the MacPorts binary package of ncurses, 
also in
version 5.9, results in an errno=1.

  echo_wchar(&wcval);
  e2 = errno;

e2: 1

does anyone by chance have an idea what might be the cause?

<http://pubs.opengroup.org/onlinepubs/009695399/functions/errno.html>:
| The value of errno shall be defined only after a call to a function
| for which it is explicitly stated to be set [...].  The value of
| errno should only be examined when it is indicated to be valid by
| a function's return value.

<http://pubs.opengroup.org/onlinepubs/007908799/xcurses/echo_wchar.html>:
| RETURN VALUE
|     Upon successful completion, these functions return OK. Otherwise,
|     they return ERR.
| ERRORS
|     No errors are defined.

So, to detect errors, you should check for echo_wchar() itself returning
ERR, and even then, the value of errno is not defined.

yes - even though the SVr4 curses would define errno's, X/Open curses
generally does not.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]