From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by sourceware.org (Postfix) with ESMTPS id D84333857028 for ; Fri, 21 Aug 2020 00:35:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D84333857028 Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 049F03F2D5C1 for ; Thu, 20 Aug 2020 17:35:44 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ypN9TYlGAJ2d for ; Thu, 20 Aug 2020 17:35:43 -0700 (PDT) Received: from keithp.com (koto.keithp.com [10.0.0.2]) by elaine.keithp.com (Postfix) with ESMTPSA id A69453F2D5B8 for ; Thu, 20 Aug 2020 17:35:43 -0700 (PDT) Received: by keithp.com (Postfix, from userid 1000) id 8A4F115821C1; Thu, 20 Aug 2020 17:35:43 -0700 (PDT) From: Keith Packard To: newlib@sourceware.org Subject: [PATCH 0/2] Floating point conversion warning fixes [v2] Date: Thu, 20 Aug 2020 17:35:37 -0700 Message-Id: <20200821003539.942952-1-keithp@keithp.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2020 00:35:46 -0000 Thanks much to both Joseph Myers and C Howland for explaining how the constants in math.h should be defined and encouraging me to figure out why clang's builtin classification macros weren't being used. This series removes all of those changes to math.h and enables the clang builtins for isinf and friends. My goal is to be able to compile the math code with -Wdouble-promotion -Werror=double-promotion which will flag any un-intended use of the default float promotion rules as an error. This will ensure that systems with only float acceleration will not accidentally use soft double code. This patch only addresses a handful of actual bugs of this form; most of the changes are to mark places where promotion was intended. Here are the files with bugs that this patch addresses: newlib/libm/common/sf_logb.c newlib/libm/complex/cephes_subrf.c newlib/libm/math/wf_scalb.c The rest of the changes serve to quiet the compiler so that those bugs could be found, and so that future bugs will be caught.