GETWC(3POSIX)
π GETWC(3POSIX) β the POSIX Programmer's Manual glow-up π
okay bestie, so this one lives in the POSIX Programmer's Manual, and it's literally the page for getwc. grab a boba, we're doing this π§β¨
πΈ PROLOG πΈ
Real talk first, no cap: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β so if you're on Linux, go consult the corresponding Linux manual page for the deets on Linux behavior. Also possible: the interface may not be implemented on Linux at all. It's giving "check your local listings" π
β¨ NAME β¨
getwc β get a wide character from a stream π¦
π SYNOPSIS π
#include <stdio.h>
#include <wchar.h>
wint_t getwc(FILE *stream);
π DESCRIPTION π
So the functionality on this reference page is aligned with the ISO C standard. And if there's any conflict between what's written here and the ISO C standard? That conflict is unintentional, okay, it's not that deep. This volume of POSIX.1β2017 defers to the ISO C standard. periodt π
Now the actual tea: getwc() shall be equivalent to fgetwc(), except β and this is the plot twist β if it's implemented as a macro, it may evaluate stream more than once. So the argument should never be an expression with side-effects. ma'am. do not do that. π
π RETURN VALUE π
Refer to fgetwc(). that's it, that's the section π«Ά
π₯ ERRORS π₯
Refer to fgetwc(). same energy, same answer π
The following sections are informative. (aka the chill, non-normative part of the page, keep scrolling bestie)
π EXAMPLES π
None. zero. nothing. the void. π
β APPLICATION USAGE β
okay so here's the warning label: since getwc() may be implemented as a macro, it may treat a stream argument with side-effects incorrectly. Specifically β and I need you to hear this β getwc(*f++) does not necessarily work as expected. π±
Therefore, use of this function is not recommended. Use fgetwc() instead. that's the whole vibe check. π
bestie please just use fgetwc(). I'm begging. π₯Ί
π§ RATIONALE π§
None. πΈ
π FUTURE DIRECTIONS π
None. π
π¦ SEE ALSO π¦
- Section 2.5, Standard I/O Streams,
fgetwc() - The Base Definitions volume of POSIX.1β2017,
<stdio.h>,<wchar.h>
π COPYRIGHT π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page, bestie!! π this icon was brought to you by IEEE/The Open Group, 2017, GETWC(3POSIX) β mwah, go forth and fgetwc() responsibly πβ¨π¦
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms