[PATCH] sbin/mount WARNS=6 cleanups

Matthew Dillon dillon at apollo.backplane.com
Sat Apr 2 13:56:26 PST 2005


: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 at xxxxxxxxxxxx>'
:Key retrieval: Send an E-Mail to getpgpkey at xxxxxxxxx
:E-Mail: peter.schuller at xxxxxxxxxxxx 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





More information about the Submit mailing list