delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/08/10/15:45:04

From: Kai Dietrich <toepferei DOT dietrich AT t-online DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: if(a==0xff) warning
Date: Fri, 10 Aug 2001 21:40:07 +0200
Organization: T-Online
Lines: 19
Message-ID: <9l1dan$nq3$01$1@news.t-online.com>
Mime-Version: 1.0
X-Trace: news.t-online.com 997472407 01 24387 L2uqSb9VSgHzy2 010810 19:40:07
X-Complaints-To: abuse AT t-online DOT com
X-Sender: 320009961467-0001 AT t-dialin DOT net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi!

What does that mean:

char a;

a=0xff;

if(a==0xff)foo();


C:\>gcc foo.cpp -o foo.exe
foo.cpp: In function `void main()':
foo.cpp:598: warning: comparison is always false due to limited range of
data
type

the line es exactly the line if(a==0xff)foo();  I don't understand why
gcc reports a warning.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019