From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by sourceware.org (Postfix) with ESMTPS id 4EA8D3857032 for ; Mon, 10 Aug 2020 15:10:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4EA8D3857032 Received: by mail-qv1-xf32.google.com with SMTP id s15so4364688qvv.7 for ; Mon, 10 Aug 2020 08:10:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eq8T4+tFH7eG+I6C9SdJcf97dh2daMzrvB1umOmWQ8E=; b=fg/5wBxKkx7EpyBanolxiRwAfPhBSxu6reHBFPkt6fatG1Z9M+S4tOE6K8tORZzAjs HvU9fI3IUKKEHLDieknMWmHKPZmqUsrXR9/0phE4Kru0+uGxUOHcdsGyIt729onxoyBN JPnlhOX9lGa00QAaLc71yGl1ge1EWNiVPZP6VXl18KEhre5JM8WDlQs86T85WZ9t2QVa RLigYyFo5XuulWpbS5DStTmVmZZE1yhiybG2jTm0w23pr4HTNFmjog3EzC+6U+1+v7oZ 3pgfd4DJvijQr5MrtFRl971kEUv8JLznLP4hutHzdzHeHH+hQQibaCM6bapJz9ImxpAv 1vRQ== X-Gm-Message-State: AOAM531m0f353zZTE0whN9QjJNtZRN/+dZdNBsL94A9Z+UdBTeXOAW1u 3XFD739rsolKo/5YpwJiM08LoVmt X-Google-Smtp-Source: ABdhPJzH3XyIUN7NXcL2eaqatUgU1jndN5YAmFtE/EtGj3GelofbI5GWDrJUavCtAfXr1S9HsStI1A== X-Received: by 2002:a05:6214:11a8:: with SMTP id u8mr27368784qvv.88.1597072215266; Mon, 10 Aug 2020 08:10:15 -0700 (PDT) Received: from [192.168.0.41] (184-96-226-5.hlrn.qwest.net. [184.96.226.5]) by smtp.gmail.com with ESMTPSA id w18sm16996211qtk.1.2020.08.10.08.10.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Aug 2020 08:10:14 -0700 (PDT) Subject: Re: Diagnostic format of warnings To: "Licht, Martin" , "gcc-help@gcc.gnu.org" References: From: Martin Sebor Message-ID: Date: Mon, 10 Aug 2020 09:10:13 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2020 15:10:17 -0000 On 8/10/20 5:51 AM, Licht, Martin via Gcc-help wrote: > Hello, > > I have got a question regarding diagnostic output in GCC. > > It seems that some diagnostic messages receive a color markup on my shell whereas others don't. For example, the word "warning" is purple for -Wfloat-equal whereas for -Winline it is not. > > My guess is that some warnings happen before code generation (such as -Wfloat-equal) whereas other warnings happen after code generation (such as -Winline) and thus are treated differently. > > I am wondering that is the intentional default on the GCC. It seems rather arbitrary to use such different formats for warnings. Diagnostics should be colorized regardless of when they are issued (by the front end, during optimization, or expansion). I think I've seen them lose color in older versions of GCC and during LTO but I think that was fixed. If it persists with newer versions of GCC or happens under some other conditions we would need to see a test case that reproduces it to say much more. Martin