From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3819 invoked by alias); 31 Jul 2006 15:36:07 -0000 Received: (qmail 3811 invoked by uid 22791); 31 Jul 2006 15:36:06 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-send.myrealbox.com (HELO smtp-send.myrealbox.com) (151.155.5.143) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 31 Jul 2006 15:36:05 +0000 Received: from tprince [143.183.121.2] by myrealbox.com with NetMail ModWeb Module; Mon, 31 Jul 2006 15:36:03 +0000 Subject: Re: A From: "Timothy C Prince" To: wg_nwpu@yahoo.com.cn CC: gcc-help@gcc.gnu.org Date: Mon, 31 Jul 2006 15:36:00 -0000 X-Mailer: NetMail ModWeb Module X-Sender: tprince MIME-Version: 1.0 Message-ID: <1154360163.c7dcd69ctprince@myrealbox.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-07/txt/msg00377.txt.bz2 -----Original Message----- From: bacmoz a =3D 1<<(8 * sizeof(unsigned long long) - 1); // here give a warning i don't know why i cannot get 1<<63 in my c program. if change the type "unsigned long long" to "unsigned int", the result is ok. _________________________________________________-- Perhaps you mean to use a constant of some type other than int, such as 1LL= . The result of shifting an int (32 bits on your platform) by 63 bits is h= ardware dependent, so gcc warns you. I know you meant the code to be platf= orm dependent (e.g. by assuming 8 bits per byte), but gcc wants to help you= anyway. Tim Prince