Mail Archives: djgpp/1996/08/08/04:30:11
Xref: | news2.mv.net comp.os.msdos.djgpp:6941
|
From: | frazer AT rtp DOT ericsson DOT se
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: warning problem
|
Date: | Wed, 07 Aug 1996 15:25:20 GMT
|
Organization: | Ericsson Inc.
|
Lines: | 18
|
Message-ID: | <4ua1pr$9ng@cnn.exu.ericsson.se>
|
References: | <4u9cju$p5p AT news DOT ysu DOT edu>
|
NNTP-Posting-Host: | pc340.rtp.ericsson.se
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
ac387 AT yfn DOT ysu DOT edu (randall williams) wrote:
>I haven't had time to look at the FAQ yet, but what is wrong with this?
>while(x[b]!=10&&x[b]!=13&&x[b]!=EOF&&b<128)
>warning: comparison is always 1 due to limited range of data type
>The above is the line causing the warning and I have an if() that
>causes a similar warning. Maybe I'm just missing something in my logic
>though I don't understand it. the variables are char x[], and int b.
EOF is sometimes defined as -1 and char's are usually unsigned
( >= 0 ), so that may be your problem.
Hope this helps,
Scott
- Raw text -