Re: strcpy -> strlcpy?

看板DFBSD_kernel作者時間21年前 (2005/01/05 20:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串11/13 (看更多)
Not to play devil's advocate, but with the contrib framework we have in place, it shouldn't be much of a trouble to add those in, unless the GCC guys are ready to merge them. Hiten Pandya hmp at freebsd.org On Tue, 4 Jan 2005, Matthew Dillon wrote: : ::If you're interested, we've got some simple modifications in the OpenBSD ::gcc (both 2.95 and 3.3) which checks for these kinds of errors. It ::does need relevant functions like strlcpy(3) to be marked up with ::attributes to indicate which arguments are buffers and which are buffer ::sizes. :: ::I haven't had a chance to feed these back into gcc, but they should be ::pretty easy to extract from the OpenBSD tree, and are documented here: ::http://www.openbsd.org/cgi-bin/man.cgi?query=gcc-local :: ::-- ::Anil Madhavapeddy http://anil.recoil.org ::University of Cambridge http://www.cl.cam.ac.uk : : Well... I think that might be overkill. I can see where it would help : people doing large code updates but in all the code I've ever looked at : in FreeBSD and DragonFly I found that sort of sizeof(pointer) conversion : error only once or twice, a few years ago in the FreeBSD tree. That just : isn't enough to justify maintaining a compiler hack for it. : : -Matt : Matthew Dillon : <dillon@backplane.com> :
文章代碼(AID): #11szv700 (DFBSD_kernel)
討論串 (同標題文章)
文章代碼(AID): #11szv700 (DFBSD_kernel)