Commit be327c6ebe408ae144e9c93aab9cb65fce116f33

Guillem Jover 2022-08-24T01:58:58

fgetwln: Add comment about lack of getwline(3) for recommendation Ideally we'd recommend getwline(3), but unfortunately even though it was part of the ISO/IEC TR 24731-2:2010 draft, it did not make it into C11 and is not widely implemented.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/fgetwln.c b/src/fgetwln.c
index f2ea094..0b8e7d9 100644
--- a/src/fgetwln.c
+++ b/src/fgetwln.c
@@ -87,6 +87,9 @@ fgetwln(FILE *stream, size_t *lenp)
 	*lenp = wused;
 	return wused ? fb->wbuf : NULL;
 }
+/* XXX: Ideally we'd recommend getwline(3), but unfortunately even though it
+ * was part of the ISO/IEC TR 24731-2:2010 draft, it did not make it into C11
+ * and is not widely implemented. */
 libbsd_link_warning(fgetwln,
                     "The fgetwln() function cannot be safely ported, use fgetwc(3) "
                     "instead, as it is supported by C99 and POSIX.1-2001.");