From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23670 invoked by alias); 22 May 2019 14:58:14 -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 23661 invoked by uid 89); 22 May 2019 14:58:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=majority, finalized, unsafe, complicate X-HELO: mail-qk1-f177.google.com Received: from mail-qk1-f177.google.com (HELO mail-qk1-f177.google.com) (209.85.222.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 May 2019 14:58:13 +0000 Received: by mail-qk1-f177.google.com with SMTP id f126so1653942qkc.9 for ; Wed, 22 May 2019 07:58:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=cEqF7NTbWjVBrWNEaJIso6lh7RiY72HQIFOB6bf9YmU=; b=JXVj4vyMH50ikP74m9El3cjeO0TCqBThe/uwh2g97vhug+7+nIe9alYxLiEwKeSG4g homFXVSqtS/2oBqVc9TVwtYSRXw06oBH3wqXNj6ZB8lsS4wFU+1VYZTOz9Fqz6JwWLgJ r66d2C1T+3+7M5Yic4oPhC2lVPelZ8+pKFygc++HdJBEy/SH8ve8kBMekL+nCcgK/70S i3gNSQ04+DxpUsPsT+YiOZLtGngKtmqPCaeTDvvN7GyMbcssFlx6XxjnATJ20f8NIC3n 2IifcH8KqK4baexoDKDNEUGnWbUMDDxNR0dAVb0J5nMuDkV7ZnwvrxMOGY6EoVbHn32C J11A== Return-Path: Received: from [192.168.0.41] (97-118-125-210.hlrn.qwest.net. [97.118.125.210]) by smtp.gmail.com with ESMTPSA id q56sm15190198qtk.72.2019.05.22.07.58.09 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 07:58:10 -0700 (PDT) Subject: Re: -Wformat-diag: floating-point or floating point? To: "Richard Earnshaw (lists)" , Bill Schmidt , gcc@gcc.gnu.org References: <5ddd8f0f-e2f0-62f2-ae38-c860398cb4bb@gmail.com> <0c874cf4-4f78-f439-4546-942f8855bf63@linux.ibm.com> <56afc1d8-058d-0086-291a-3fccda08be25@arm.com> <9c85ce74-1459-094d-0c6b-3fcffb0e7f4f@linux.ibm.com> From: Martin Sebor Message-ID: Date: Wed, 22 May 2019 14:58:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00186.txt.bz2 On 5/22/19 6:27 AM, Richard Earnshaw (lists) wrote: > On 22/05/2019 13:17, Bill Schmidt wrote: >> On 5/22/19 5:19 AM, Richard Earnshaw (lists) wrote: >>> On 21/05/2019 21:18, Bill Schmidt wrote: >>>> On 5/21/19 11:47 AM, Martin Sebor wrote: >>>>> The GCC coding style says to use "floating-point" as an adjective >>>>> rather than "floating point."  After enhancing the -Wformat-diag >>>>> checker to detect this I found a bunch of uses of the latter, such >>>>> as in: >>>>> >>>>>   gcc/c/c-decl.c:10944 >>>>>   gcc/c/c-parser.c:9423, 9446, 9450, etc. >>>>>   gcc/convert.c:418, 422 >>>>>   gcc/cp/call.c:5070 >>>>>   gcc/cp/cvt.c:886 >>>>> >>>>> Before I fix them all and adjust the tests, I want to make sure >>>>> we really want to follow this rule.  The C standard uses both >>>>> interchangeably.  With just one exception, the C++ standard uses >>>>> the hyphenated form. >>>> The hyphenated form is correct English, so I certainly prefer it. :-) >>>> >>> It's not quite as simple as that. Hyphens should be used to make it >>> clear what is the adjective and what is the noun: >>> >>> A floating-point number (hyphenated) is a number with a >>> floating point (no hyphen). >>> >>> In the first case 'floating-point' is the adjective and qualifies >>> number. In the second case 'floating' is the adjective and qualifies >>> 'point'. >>> >>> But this is English, so there are probably some exceptions even then - >>> but not in this case, I think. :-) >> >> English is always fun, agreed -- Martin cited the requirement to use >> "floating-point" when it's used as an adjective, which is certainly correct. >> >> There's a more interesting question around cavalier usage such as, >> "We should use floating point."  I would argue that there is an implied >> noun "arithmetic" modified here, so this should also be hyphenated, >> but I daresay there would be people on both sides of this one... > > I would argue that leaving out "arithmetic" is the error. :-) I agree. Unfortunately, there are a few cases like that among the diagnostics that my script has already fixed: decimal floating point not supported comparing floating point with %<==%> or % is unsafe ISO C does not support decimal floating point They probably should read decimal floating point types not supported comparing floating-point values with %<==%> or % is unsafe ISO C does not support decimal floating point types I think they can be adjusted later if we think it's important, after the checker is finalized and committed. I don't want to complicate it too much by having to differentiate between adjectives and nouns. The vast majority of the "floating point" instances is has found are adjectives. Martin >> This is why grammar police usually die from friendly fire. :-) >> > > Sticking your head above the parapet is always fraught with danger :) > > > R. >