followup (trunk only)
Finally found a flag combination that will complain about declarations mixed in with other code: -ansi -pedantic. Clean up the violations of that I just introduced and add that flag to the Mac 10.5 hints file. (Note that there is one warning left in unixmain.c - it's in Mac-specific code.)
This commit is contained in:
@@ -50,7 +50,7 @@ GAMEUID = root
|
|||||||
GAMEGRP = games
|
GAMEGRP = games
|
||||||
|
|
||||||
#CC=gcc -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
|
#CC=gcc -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
|
||||||
CC=gcc -Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi
|
CC=gcc -Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic
|
||||||
|
|
||||||
#
|
#
|
||||||
# You shouldn't need to change anything below here.
|
# You shouldn't need to change anything below here.
|
||||||
|
|||||||
+5
-3
@@ -583,11 +583,13 @@ check_user_string(optstr)
|
|||||||
char *optstr;
|
char *optstr;
|
||||||
{
|
{
|
||||||
struct passwd *pw = get_unix_pw();
|
struct passwd *pw = get_unix_pw();
|
||||||
|
int pwlen;
|
||||||
|
char *eop, *w;
|
||||||
if(optstr[0] == '*') return TRUE; /* allow any user */
|
if(optstr[0] == '*') return TRUE; /* allow any user */
|
||||||
if(!pw) return FALSE;
|
if(!pw) return FALSE;
|
||||||
int pwlen = strlen(pw->pw_name);
|
pwlen = strlen(pw->pw_name);
|
||||||
char *eop = eos(optstr);
|
*eop = eos(optstr);
|
||||||
char *w = optstr;
|
*w = optstr;
|
||||||
while( w+pwlen <= eop ){
|
while( w+pwlen <= eop ){
|
||||||
if( ! *w ) break;
|
if( ! *w ) break;
|
||||||
if( isspace(*w) ){ w++; continue;}
|
if( isspace(*w) ){ w++; continue;}
|
||||||
|
|||||||
Reference in New Issue
Block a user