From: Roman Suzi Newsgroups: comp.os.msdos.djgpp Subject: [Q]: unsigned char Date: Thu, 23 Oct 97 19:36:47 +0300 Distribution: su Organization: unknown Message-ID: Sender: news-service AT sampo DOT karelia DOT ru Reply-To: nuser AT rsuzi DOT pgu DOT karelia DOT ru Lines: 66 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi, all! I have encountered a problem with porting a program from BC++ 3.1 to gnu c++ (from DJGPP 2.01 package). The problem is best seen in this example of code: -------------------------------------------------- unsigned char a; a = 253; if (a=='\xFD') { ... }; -------------------------------------------------- Compiler gives warning, that "comparison is always 0 due to limited range of data type" (no matter with or without '-funsigned-char' flag) There were nothing of the sort in BC. When I use signed char a, the warning disappears, but other things dont work properly (e.g., xlat[b] ). Is there any regular and efficient way to have unsigned chars and comparisons with symbols above 127? Are there any documents about porting programs from BC/TC to DJGPP/gnu C++ beyond djgppfaq? Thank you for answer. Sincerely yours, Roman -- -- * -- -- Roman A. Suzi * Petrozavodsk Karelia Russia -- -- http://www.angelfire.com/ks/sudensivu --