<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Jan 3, 2017 at 3:20 PM Richard Smith via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">The following glibc functions in <string.h> take both a pointer and a size providing an upper limit on the number of bytes that may be accessed through that pointer, and mark the pointer as __attribute__((nonnull)):<br></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">ISO C:</div><div class="gmail_msg">  memcpy, memmove, memset, memcmp, memchr, memrchr</div><div class="gmail_msg">  strncpy [param 1 only], strncat [param 1 only], strncmp</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Extensions:</div><div class="gmail_msg">  strndup, memccpy, mempcpy, strnlen, bcopy, bzero, bcmp, memfrob,</div><div class="gmail_msg">  strncasecmp, strncasecmp_l [not parameter 4], stpncpy<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I would be interested in covering at least the ISO C functions. I don't have strong opinions about the extensions (any code built using those is likely also compiled with GCC, and so presumably has to fix this regardless).</div></div></div></div></blockquote><div><br></div><div>I would argue strongly to cover bcopy, bzero, and bcmp at the very least. These are BSD in origin and if anything I suspect there is *more* code at risk of failure using those routines.</div><div><br></div><div>Looking at the list, I don't see any reason not to cover all of them.</div></div></div>