Re: [PATCH] sbin/mount WARNS=6 cleanups

看板DFBSD_submit作者時間21年前 (2005/04/03 06:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/3 (看更多)
:mount.patch: : : * made appropriate functions static : * replaced unchecked strdup():s with xstrdup() : :mount2.patch: : : Depends on mount.patch. : : Separate patch since I suspect this might not be so popular. It fixes : the discarded const qualifier problem (which is fundamentally caused by : the signature of getopt()) by duping the array before calling mount_ufs() : and before the execv. The rest of mount.c is heavily dependent on constant : strings and pointer acrobatics that does not play well with the idea of : making argv a char**. I felt this was the cleaner solution. : : Since this removes the last triggered warning, it also bumps WARNS to 6. : :-- :/ Peter Schuller, InfiDyne Technologies HB : :PGP userID: 0xE9758B7D or 'Peter Schuller <peter.schuller@infidyne.com>' :Key retrieval: Send an E-Mail to getpgpkey@scode.org :E-Mail: peter.schuller@infidyne.com Web: http://www.scode.org I committed the first part. The second part is a bit too much of a hack just to fix the qualifiers. That actually seems to me to be a bug in GCC. It shouldn't have any problem casting char ** to char * const * but it does. -Matt
文章代碼(AID): #12JnOg00 (DFBSD_submit)
文章代碼(AID): #12JnOg00 (DFBSD_submit)