From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27994 invoked by alias); 5 Mar 2008 09:20:46 -0000 Received: (qmail 27985 invoked by uid 22791); 5 Mar 2008 09:20:45 -0000 X-Spam-Check-By: sourceware.org Received: from gv-out-0910.google.com (HELO gv-out-0910.google.com) (216.239.58.187) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 05 Mar 2008 09:20:25 +0000 Received: by gv-out-0910.google.com with SMTP id r4so1065939gve.10 for ; Wed, 05 Mar 2008 01:20:22 -0800 (PST) Received: by 10.114.121.1 with SMTP id t1mr3944941wac.67.1204708821039; Wed, 05 Mar 2008 01:20:21 -0800 (PST) Received: from ghost ( [221.218.190.195]) by mx.google.com with ESMTPS id z15sm1047739pod.11.2008.03.05.01.20.13 (version=SSLv3 cipher=OTHER); Wed, 05 Mar 2008 01:20:15 -0800 (PST) Date: Wed, 05 Mar 2008 09:20:00 -0000 From: "PRC" To: "gcc-help" Subject: how gcc thinks `char' as signed char or unsigned char ? Message-ID: <200803051719569448630@gmail.com> X-mailer: Foxmail 6, 10, 201, 20 [cn] Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg00036.txt.bz2 --------------------------------- int main() { char a = -7; if( a < -9 ) printf("a"); else printf("b"); } --------------------------------- sde-gcc -c a2.c c:/a2.c: In function `main': c:/a2.c:6: warning: comparison is always false due to limited range of data type It may be the reason for this warning that gcc thinks `char' as 'unsigned char' by default. Can I change the default configuration by modifying some configuration file? Or this feature can't be changed after gcc has been built?