From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115630 invoked by alias); 5 Mar 2018 07:42:47 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 115619 invoked by uid 89); 5 Mar 2018 07:42:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*c:alternative X-HELO: mail-vk0-f50.google.com Received: from mail-vk0-f50.google.com (HELO mail-vk0-f50.google.com) (209.85.213.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Mar 2018 07:42:46 +0000 Received: by mail-vk0-f50.google.com with SMTP id k187so9170090vke.12 for ; Sun, 04 Mar 2018 23:42:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=w0/XutOBwk2AlErWcdtCn+0kwPgAfp5H31UxDuBjrr4=; b=Poo1TyjJH2lczbvQN5+hqPA0e7miraUHzjM/c8ToeYm/QBUmUbx9E/+1qeJYu079Xa 3zkNHyVFTWULq7kTfMeXXWdvEUK49EXHbtzOXrrA3RMgIWLaZC333vZHpm0hQ7hXp8dt FhFQDqASXxz5rsACNTMpWjAAZdCSVMOYHpTMYF0ZjHSrrxgDL0ybp7MWjbUUWZsPmi/R CzLQoiGXG3lXPa4pbNFIybw3ZfaoeNvmfrnyb0HXRgQJ38QIHJzVkT6HTLeddFRQdm34 gHwl3TvofjM5bsC4PsJqhJoQZ/NGjznxcMtbj+XnyQREicoT2ycgbIUaX9p6iazpmf+P u9Qw== X-Gm-Message-State: APf1xPDedplC5PZcXIq8RgBgGmw6BrK2hi09hfoTVw0AR+0cB9VPvJgg ZQqKBKeTnXqfHTuU/nK3LFWkKF/ucNfSgkIbYzhHUA7V X-Google-Smtp-Source: AG47ELucADZG4QVrX40PYMYinCLMIbARUnbQ4H7BFcP39yfE7AEqoCeETHUrVjy5uG1HROMJQkhs7bcb8Tp6wMddu/U= X-Received: by 10.31.142.65 with SMTP id q62mr9322228vkd.141.1520235764122; Sun, 04 Mar 2018 23:42:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.14.26 with HTTP; Sun, 4 Mar 2018 23:42:43 -0800 (PST) From: Satya Prakash Prasad Date: Mon, 05 Mar 2018 07:42:00 -0000 Message-ID: Subject: C++ - compilation error for all implicit conversion To: gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00041.txt.bz2 Is there a compiler flag that logs warning / error in case of any implicit conversions - like int32_t to uint32_t. #include #include using ::std::int32_t; using ::std::uint32_t; int main(int argc, char *argv[]) { int32_t x = 9; uint32_t i = x; uint32_t i1 = socketread(...); // returns int32_t -1 on error and >0 on success std::cout << " " << x << " " << i << std::flush << std::endl; return 0; } c++ -std=c++11 -Wall -Wconversion -Wpedantic cast.cpp I get no issues / warning / error during compilation - is there a way it can achieved.