mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andries Brouwer <aebr@win.tue.nl>
To: tglx@linutronix.de (Thomas Gleixner)
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.4.26] drivers/char/vt.c fix compiler warnings
Date: Mon, 17 May 2004 12:47:29 +0200	[thread overview]
Message-ID: <20040517104729.GA8933@wsdw14.win.tue.nl> (raw)
In-Reply-To: <200405151505.23250.tglx@linutronix.de>

4~On Sat, May 15, 2004 at 03:05:23PM +0200, Thomas Gleixner wrote:

> The patch fixes the following warnings, produced by gcc3.3.3:
> 
> s is a unsigned char, which can never be >= MAX_NR_KEYMAPS, as MAX_NR_KEYMAPS 
> = 256

> -	if (i >= NR_KEYS || s >= MAX_NR_KEYMAPS)
> +	if (i >= NR_KEYS)
>  		return -EINVAL;	

You see that you break thew source in order to avoid a compiler warning. Bad.

(MAX_NR_KEYMAPS is a #define, often 256, on tiny systems people tend to pick 16.
The above test is not superfluous. MAX_NR_KEYMAPS is not an absolute constant.)

Andries

  reply	other threads:[~2004-05-17 10:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-15 13:05 Thomas Gleixner
2004-05-17 10:47 ` Andries Brouwer [this message]
2004-05-17 12:47   ` Thomas Gleixner
2004-05-17 13:36     ` Andries Brouwer
2004-05-17 15:40     ` Valdis.Kletnieks

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=20040517104729.GA8933@wsdw14.win.tue.nl \
    --to=aebr@win.tue.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®