[Top][All Lists]
[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: |
Clemens Ladisch |
Subject: |
Re: UTF-8 output via "echo_wchar" resulting in errno=1 on Mac OS X |
Date: |
Tue, 19 Apr 2011 15:32:10 +0200 |
User-agent: |
Thunderbird 2.0.0.24 (Windows/20100228) |
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.
Regards,
Clemens