Improve wording in alloca. 1. it's not a bug; it's a caveat. 2. "slightly unsafe" gives me the willies. 3. nobody knows what "large unbounded allocations" are. 4. one .Xr to malloc should suffice
Index: alloca.3 =================================================================== RCS file: /cvs/src/lib/libc/stdlib/alloca.3,v retrieving revision 1.13 diff -u -p -r1.13 alloca.3 --- alloca.3 5 Jun 2013 03:39:23 -0000 1.13 +++ alloca.3 16 Jan 2015 22:26:15 -0000 @@ -51,9 +51,7 @@ function returns a pointer to the beginn .Sh SEE ALSO .Xr pagesize 1 , .Xr brk 2 , -.Xr calloc 3 , -.Xr malloc 3 , -.Xr realloc 3 +.Xr malloc 3 .\" .Sh HISTORY .\" The .\" .Fn alloca @@ -62,10 +60,10 @@ function returns a pointer to the beginn .\" The function appeared in 32v, pwb and pwb.2 and in 3bsd 4bsd .\" The first man page (or link to a man page that I can find at the .\" moment is 4.3... -.Sh BUGS +.Sh CAVEATS The .Fn alloca -function is slightly unsafe because it cannot ensure that the pointer +function is unsafe because it cannot ensure that the pointer returned points to a valid and usable block of memory. The allocation made may exceed the bounds of the stack, or even go further into other objects in memory, and @@ -73,4 +71,4 @@ further into other objects in memory, an cannot determine such an error. Avoid .Fn alloca -with large unbounded allocations. +when possible.