From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3414 invoked by alias); 16 Sep 2011 10:06:08 -0000 Received: (qmail 3403 invoked by uid 22791); 16 Sep 2011 10:06:06 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_00,SPF_NEUTRAL X-Spam-Check-By: sourceware.org Received: from relmlor1.renesas.com (HELO relmlor1.renesas.com) (210.160.252.171) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Sep 2011 10:05:49 +0000 Received: from relmlir3.idc.renesas.com ([10.200.68.153]) by relmlor1.idc.renesas.com ( SJSMS) with ESMTP id <0LRM001SS1DJF9C0@relmlor1.idc.renesas.com> for gcc-help@gcc.gnu.org; Fri, 16 Sep 2011 19:05:44 +0900 (JST) Received: from relmlac4.idc.renesas.com ([10.200.69.24]) by relmlir3.idc.renesas.com ( SJSMS) with ESMTP id <0LRM00DV11DJWB10@relmlir3.idc.renesas.com> for gcc-help@gcc.gnu.org; Fri, 16 Sep 2011 19:05:43 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id CB11D4808A; Fri, 16 Sep 2011 19:05:43 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id B6ED64807B; Fri, 16 Sep 2011 19:05:43 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id VAK13743; Fri, 16 Sep 2011 19:05:43 +0900 Received: from unknown (HELO relay51.aps.necel.com) ([10.29.19.60]) by relmlii1.idc.renesas.com with ESMTP; Fri, 16 Sep 2011 19:05:41 +0900 Received: from dhlpc061 (dhlpc061.dev.necel.com [10.114.97.196]) by relay51.aps.necel.com (8.14.4+Sun/8.14.4) with ESMTP id p8GA5bQM006840; Fri, 16 Sep 2011 19:05:37 +0900 (JST) Received: by dhlpc061 (Postfix, from userid 31295) id A9F2D52E2CA; Fri, 16 Sep 2011 19:05:37 +0900 (JST) From: Miles Bader To: David Brown Cc: gcc-help@gcc.gnu.org Subject: Re: compile with gcc option -O0 or -O References: System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Fri, 16 Sep 2011 10:06:00 -0000 In-reply-to: Message-id: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: quoted-printable 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 X-SW-Source: 2011-09/txt/msg00138.txt.bz2 David Brown writes: >> ... but be a bit wary of any warning option which isn't included in >> -Wall or -Wextra -- they're usually omitted for a reason (typically >> because they yield tons of false positives on reasonable code). > > That depends on your definition of "reasonable code" ! Of course. :) In general, though, there is some thought behind what's included in -Wall/-Extra. Stuff that's omitted tends to be where the warnings are domain-specific, reflect programming practices which aren't widespread enough, or where the gcc implementation is simply lacking in some obvious way (sometimes it's very tricky to get the heuristics right). -Wpadded, for instance, may be very interesting for embedded devs, but probably not so much for many others, and yields vast quantities of warnings on "ordinary" code. -Wfloat-equal, on the other hand, reflects a rule of thumb which is very useful when applied intelligently (i.e., by a human), but is less well suited to automatic application. [Testing for floating-point equality is unreliable if the values being tested are the result of calculation, but _is_ reliable if the values are the result of simple assignment, especially certain values like 0.0 -- and the compiler is very unlikely to be able to distinguish these cases. If you _know_ that your code-base never, ever, tests equality in the latter case, you can safely use -Wfloat-equal, but this isn't something that can be relied upon.] -miles --=20 values of =CE=B2 will give rise to dom!