Re: [git pull] miscellaneous compiler warning fixes etc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 28, 2011 at 11:33:42PM +0200, Sami Kerola wrote:
> -	iter->done = 1;
> +	iter->done |= 1;

 Why we need this change? IMHO it's unnecessary. "A bit-field is
 interpreted as a signed or unsigned integer type consisting of the
 specified number of bits." (C99)

 [...]

> -	while((i = getopt_long(argc, argv, "+abfiphmoRrvV", longopts, NULL)) != -1)
> +	shortopts = get_shortopts("+", longopts);
> +	while((i = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1)
>  	{
>  		int ret = EXIT_FAILURE;
> 
> @@ -227,11 +275,11 @@ int main(int argc, char **argv)
>  		case 'a':
>  			all_tasks = 1;
>  			break;
> -		case 'b':
>  #ifdef SCHED_BATCH
> +		case 'b':
>  			policy = SCHED_BATCH;
> -#endif
>  			break;
> +#endif
>  		case 'f':
>  			policy = SCHED_FIFO;
>  			break;
> @@ -240,11 +288,11 @@ int main(int argc, char **argv)
>  			policy_flag |= SCHED_RESET_ON_FORK;
>  			break;
>  #endif
> -		case 'i':
>  #ifdef SCHED_IDLE
> +		case 'i':
>  			policy = SCHED_IDLE;
> -#endif
>  			break;
> +#endif
>  		case 'm':
>  			show_min_max();
>  			return EXIT_SUCCESS;
> @@ -271,6 +319,7 @@ int main(int argc, char **argv)
>  			show_usage(ret);
>  		}
>  	}
> +	free(shortopts);

 Hmm... I don't like this patch. 

 Command line options are our API, and the API should be stable
 independently on supported features. The #ifdef for command 
 line options suck...

 Note that SCHED_RESET_ON_FORK should be fixed and -R should be
 silently ignored (now whole "case SCHED_RESET_ON_FORK:" is #ifdefed.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux