From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4400 invoked by alias); 30 Mar 2005 12:02:30 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 4342 invoked by uid 48); 30 Mar 2005 12:02:25 -0000 Date: Wed, 30 Mar 2005 12:02:00 -0000 Message-ID: <20050330120225.4341.qmail@sourceware.org> From: "varun0005 at gmail dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050330095906.20689.varun0005@gmail.com> References: <20050330095906.20689.varun0005@gmail.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/20689] strict aliasing with temporary variable never gives warnings X-Bugzilla-Reason: CC X-SW-Source: 2005-03/txt/msg03439.txt.bz2 List-Id: ------- Additional Comments From varun0005 at gmail dot com 2005-03-30 12:02 ------- I mean that since in case where you are doing "void *p=(void *)&i" then according to strict-aliasing rules we get " warning: dereferencing type-punned pointer will break strict-aliasing rules" , but same thing if done using a temporary variable then why strict-aliasing warning doesn't appear.. According to my understanding of strict aliasing if some unqualified version of pointer is pointing to the address space(in out case void pointer pointing to int address space) then it is violating strict aliasing rule. So in second case also void pointer is pointing to the int address space then why strict aliasing rules are not violated. If ther is some error in my understanding of strict aliasing then please inform . -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20689