From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25923 invoked by alias); 17 Oct 2007 14:03:14 -0000 Received: (qmail 25912 invoked by uid 22791); 17 Oct 2007 14:03:12 -0000 X-Spam-Check-By: sourceware.org Received: from cluster-a.mailcontrol.com (HELO cluster-a.mailcontrol.com) (80.69.8.190) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 17 Oct 2007 14:03:03 +0000 Received: from rly34a.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly34a.srv.mailcontrol.com (MailControl) with ESMTP id l9HE2ujs011906 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 17 Oct 2007 15:02:56 +0100 Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly34a.srv.mailcontrol.com (MailControl) id l9HE20BP009350 for gcc-help@gcc.gnu.org; Wed, 17 Oct 2007 15:02:00 +0100 Received: from c2-ex002.groupinfra.com ([212.123.206.142]) by rly34a-eth0.srv.mailcontrol.com (envelope-sender jiri.humpolicek@acision.com) (MIMEDefang) with ESMTP id l9HE1Psp007382; Wed, 17 Oct 2007 15:01:59 +0100 (BST) Received: from cz-ex001.groupinfra.com ([158.234.170.116]) by c2-ex002.groupinfra.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 17 Oct 2007 15:58:48 +0200 Received: from cz-ex002.groupinfra.com ([158.234.170.118]) by cz-ex001.groupinfra.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 17 Oct 2007 15:58:47 +0200 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: gcc warnings Date: Wed, 17 Oct 2007 14:08:00 -0000 Message-ID: <53248A54C3B3EC4EAAD993D10A6DD01203C5DDA8@cz-ex002.groupinfra.com> References: <53248A54C3B3EC4EAAD993D10A6DD01203C5DAB7@cz-ex002.groupinfra.com> <4715F65A.20106@ellipticsemi.com> From: "Humpolicek, Jiri - Acision" To: "Tom St Denis" Cc: 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: 2007-10/txt/msg00218.txt.bz2 >My recommendation is to simply not assign across types unless you have=20 >to. If you have a function like > >void myfunc(unsigned long somevalue) >{ >} > >Then never store somevalue in anything but an unsigned long unless=20 >you're sure of what you are doing. Why would you write > >char careless =3D somevalue; > >just for the hell of it?=20 > >Tom I fully understand with you Tom. I don't want to write this 'correct' code, but problem is that it is easy to make this constructs inadvertently. And IMHO this is place for compiler to report warning 'Here you overlook something'. Because there is no reason do these things I think that warning is good solution. And if someone want to use these language properties without warning, it may be possible to use explicit cast to smaller type to suppress warning (that is correct because there is evidence that user knows about his doing). Thanks, Jiri Humpolicek This e-mail and any attachment is for authorised use by the intended recipi= ent(s) only. This email contains confidential information. It should not be= copied, disclosed to, retained or used by, any party other than the intend= ed recipient. Any unauthorised distribution, dissemination or copying of th= is E-mail or its attachments, and/or any use of any information contained i= n them, is strictly prohibited and may be illegal. If you are not an intend= ed recipient then please promptly delete this e-mail and any attachment and= all copies and inform the sender directly via email. Any emails that you s= end to us may be monitored by systems or persons other than the named commu= nicant for the purposes of ascertaining whether the communication complies = with the law and company policies.