From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32035 invoked by alias); 4 Feb 2014 08:11:28 -0000 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 Received: (qmail 32023 invoked by uid 89); 4 Feb 2014 08:11:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f173.google.com Received: from mail-lb0-f173.google.com (HELO mail-lb0-f173.google.com) (209.85.217.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 04 Feb 2014 08:11:25 +0000 Received: by mail-lb0-f173.google.com with SMTP id y6so6242857lbh.32 for ; Tue, 04 Feb 2014 00:11:21 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.113.5.167 with SMTP id cn7mr26821778lbd.1.1391501481882; Tue, 04 Feb 2014 00:11:21 -0800 (PST) Received: by 10.112.143.70 with HTTP; Tue, 4 Feb 2014 00:11:21 -0800 (PST) In-Reply-To: <52EFD3C2.6030209@bo.infn.it> References: <52EFD3C2.6030209@bo.infn.it> Date: Tue, 04 Feb 2014 08:11:00 -0000 Message-ID: Subject: Re: question From: Jonathan Wakely To: Graziano Servizi Cc: gcc-help Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00020.txt.bz2 On 3 February 2014 17:37, Graziano Servizi wrote: > How could this (included) very short code work? > It isn't a NOT SAFE conversion that made inside void fun? (This is not a question about GCC, so it would be better in a general C++ forum.) static_cast does not check for safe conversions, it's your responsibility to use it correctly. If you aren't sure the conversion is safe then use dynamic_cast.