Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: kerolasa@gmail.com
Cc: util-linux <util-linux@vger.kernel.org>
Subject: Re: [git pull] miscellaneous compiler warning fixes etc
Date: Fri, 29 Jul 2011 00:44:30 +0200	[thread overview]
Message-ID: <20110728224430.GB24754@nb.net.home> (raw)
In-Reply-To: <CAG27Bk1-X+eqrVwP7cfZp-9-aCBwPtnYYBRJGi7wBt2-zaOMjA@mail.gmail.com>

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@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2011-07-28 22:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-28 21:33 [git pull] miscellaneous compiler warning fixes etc Sami Kerola
2011-07-28 22:44 ` Karel Zak [this message]
2011-07-29  8:46   ` Karel Zak
2011-07-29  9:03     ` Sami Kerola
2011-07-29  9:07       ` Karel Zak
2011-08-02 12:32 ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110728224430.GB24754@nb.net.home \
    --to=kzak@redhat.com \
    --cc=kerolasa@gmail.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox