Re: perror() changes the orientation of stderr to byte-oriented mode if stderr is not oriented yet.
Corinna Vinschen <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
On Jun 28 12:28, Craig Howland wrote: > On 06/27/2018 08:55 AM, Corinna Vinschen wrote: > > ... > > > > > > On Jun 27 20:01, Takashi Yano wrote: > > > POSIX states: > > > The perror() function shall not change the orientation of the standard > > > error stream. > > > > > > However, cygwin perror() function changes the orientation of stderr to > > > byte-oriented mode if stderr is not oriented yet. > I suggest that POSIX is in error. The POSIX statement about not changing > the orientation is an extension to the C standard (CX, to be precise). > POSIX is always careful to defer to the C standard, which I think does > indirectly specify that perror() is byte-oriented. The C standard actually > does not directly talk about the orientation of perror(). However, it > directly defines (quoting from the N1570 C11 draft): > [...] > Therefore, the newlib perror() behavior is correct and should not be > changed. It definitely is a mess and there really ought to be a perrorw() > function. Interesting discussion. Under the assumption the standard isn't quite clear on this, we have OpenBSD, FreeBSD and Linux interpreting the standard as "don't change orientiation from perror". NetBSD doesn't care, just like Newlib. As far as I can see, the NetBSD and the Newlib code are older than the interpretation of the other three. Does the new interpretation set a precedent? Corinna -- Corinna Vinschen Cygwin Maintainer Red Hat
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAls1LJ4ACgkQ9TYGna5E T6D8Rw//d1UvYMGArkN7O4qSogYcfIDD2lcp0VuXduU+ut7MxmrWCwc/BZ+ElUrJ PBGPwOw2mSCCcZ5Uez/TRvhrSZ71r7IItIyQasAYyMHUSP2vp03d4Ll2UAUjcYJy Gn0ji7Vx/OA3K8ROJ3QWx/8OU6/2kr5AORQuJAmNPDyqAuaxVDs1gD0GYpuFxu8R 6dGimyeRYxrqtvHibEXzOe3Ifn0tMyEZiH2pXJPIRwaCEtHs+SY2YUk4Dq20WcTG gEc2nQjWAwLjDq+6z43q0JnVO/SF/lMkh3W4iUQ4OEWaQkJQrUq9IVGIvW2CgNjq Umv/TgLQzyeB2kN9W1Oqmb2WXS/e+fnus26JAhV11IYM8Ku4i2u/Pc5aU39Ora7m M1PueIPOXo64eXZuN4BscF7OAB2mdS/JBMUKqHy8MZM4Tqt0/q+X8g6QwvHWe9Ap F30zo35H414H9JWpwTWHvSle+m4ioInxq1TI/zDuRCR64Bff+TGAJmqmgZiyWm7O mK2MHsgOMow6g9rEVpPtZMvyg+v7ziUws6iad9RvzLa5S/mWgDQ9UxpF0cq8lXRl SqDd5FfikOuW45poZKjbsDnT3krY9RR5DweLNd3aeATLB2H4KFpyBxPIc7XsAUEp 4+H340ReTanF/oCLA7+SYnV/CvW1sn56VaWpLqy/wKPWZv+lVIg= =Opsu -----END PGP SIGNATURE-----