From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by sourceware.org (Postfix) with ESMTPS id 33D223858D1E for ; Wed, 24 Jan 2024 05:38:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 33D223858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=systematicsw.ab.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=systematicsw.ab.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 33D223858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=216.40.44.13 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706074739; cv=none; b=XOJb7SBk60KE1P20EwGdcA9dMm5exgBTmEB4Q5uV6LLBfccW7q3IIISyfG2dUBvmwvmUd64wvXpOgfKXTyxslKumemK0ItO1qAN9DPRJmSqmalLvFfYrtwYBcEzwo8uueKWMkFYTjBcGdDPv3LvTmMTlEW4wvzKCyuf3A+Yrvnw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706074739; c=relaxed/simple; bh=48NzF9uD2b8KSThJBoXOrZXx6CBclb4fMwZEqet8TrY=; h=Message-ID:Date:MIME-Version:From:Subject:To; b=ioCvVKmWlNBK/rXIYCYdohMZI5bLZUC576HqefQMCPPi01TS1m975VWVW2olJSO+ySH2gSs8xFZ2Qzv2XZ0jdVGmZ/DsovTrREii0oRfU1NxjRWGbt1R8BtyKC5W1CqiXcImkITMDIrhG+Ah4TKjPkHCUhv78axcZ8xpRyE0rOI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from omf02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4569C140AE0 for ; Wed, 24 Jan 2024 05:38:56 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: Brian.Inglis@SystematicSW.ab.ca) by omf02.hostedemail.com (Postfix) with ESMTPA id C96FF8000E for ; Wed, 24 Jan 2024 05:38:54 +0000 (UTC) Message-ID: Date: Tue, 23 Jan 2024 22:38:53 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: brian.inglis@systematicsw.ab.ca Reply-To: newlib@sourceware.org Subject: Re: -Wall Content-Language: en-CA To: newlib@sourceware.org References: <9d3d3c81-e8e1-4e75-b585-d6425cbc5335@systematicsw.ab.ca> Autocrypt: addr=brian.inglis@systematicsw.ab.ca; keydata= xjMEXopx8xYJKwYBBAHaRw8BAQdAnCK0qv/xwUCCZQoA9BHRYpstERrspfT0NkUWQVuoePbN LkJyaWFuIEluZ2xpcyA8QnJpYW4uSW5nbGlzQFN5c3RlbWF0aWNTdy5hYi5jYT7ClgQTFggA PhYhBMM5/lbU970GBS2bZB62lxu92I8YBQJeinHzAhsDBQkJZgGABQsJCAcCBhUKCQgLAgQW AgMBAh4BAheAAAoJEB62lxu92I8Y0ioBAI8xrggNxziAVmr+Xm6nnyjoujMqWcq3oEhlYGAO WacZAQDFtdDx2koSVSoOmfaOyRTbIWSf9/Cjai29060fsmdsDM44BF6KcfMSCisGAQQBl1UB BQEBB0Awv8kHI2PaEgViDqzbnoe8B9KMHoBZLS92HdC7ZPh8HQMBCAfCfgQYFggAJhYhBMM5 /lbU970GBS2bZB62lxu92I8YBQJeinHzAhsMBQkJZgGAAAoJEB62lxu92I8YZwUBAJw/74rF IyaSsGI7ewCdCy88Lce/kdwX7zGwid+f8NZ3AQC/ezTFFi5obXnyMxZJN464nPXiggtT9gN5 RSyTY8X+AQ== Organization: Systematic Software In-Reply-To: <9d3d3c81-e8e1-4e75-b585-d6425cbc5335@systematicsw.ab.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C96FF8000E X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,BODY_8BITS,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Stat-Signature: xftea5wczh39csbu85epott99ei98j11 X-Rspamd-Server: rspamout01 X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361 X-Session-ID: U2FsdGVkX1/Z3SVXnBKctyepbPQbF1eUV2ZYXE2KlVI= X-HE-Tag: 1706074734-259009 X-HE-Meta: U2FsdGVkX18UVLY+NuHHkb4zFObmQaz4psYK4Rs0BmYuvVeI2r++3CDyugM+DYXziQ1BkPggEiViq/Rre1xS5E82TEqXNzBUWgD086qko3dhfEXr/G7R5eQuSO04YrEMjRrjWIUZCIFrK7uZQQlPkMjFSHMElowgKmlZPv8N7NcJkLze1BYn2cr1KxG8GTcDtwsuVmaP8cGSA4BlLd35X07WVbap10bb9RGnweQSkl4EftvIQyEg/INFWjaGv1eFNqHF+LJ08ZTdy894ocxTTfchypNI3ozPU8i+ZUb8QVJSUFgiiJ/EPSVbmPVUO3dK4O/HeE70XqNHEGcC2juVWM7gO6ZXWG7lDQjm8H4M9c/kvKxaFa98lF11JKV4aPuaH1XrzVVBKIbTiobYyE99in4VRZFxZ3iPGKiA3+KndtLrwjx0h0EszwBpUUZ2wLPJ X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2024-01-20 11:17, brian.inglis@systematicsw.ab.ca wrote: > On 2024-01-19 05:55, Corinna Vinschen wrote: >> if you saw my today's pushes, you're aware that I only found a bug >> because I used -Wall.  I fixed the bug and a few less crucial warnings. >> I did NOT fix the warnings in code we took verbatim from some BSDs, >> which often contain unused variables, or in some cases expressions which >> are deemed to profit from extra paranthesis, e. g. >>    if (a >= 0 ^ b == 0) >> For that reason, I'd like to suggest to add -Wall by default to the >> build flags for newlib, just as it is already for ages in the Cygwin >> tree. >> Anybody having a strong opinion, pro or contra? > ++ > I also like: >     -Wextra -Wformat=2 -Wformat-overflow=2 -Werror=format-security > to get more useful warnings, and error if there are security issues like totally > variable format strings; use `info gcc W...` for descriptions; YL/100kmMV > I have also found the following work well for development with recent gcc: >     -fanalyzer -fsanitize-recover=all >     -fstack-check -fstack-protector-all >     --param=ssp-buffer-size=4 > but may be inappropriate for production builds; use `info gcc f...` for > descriptions. Linux added -Wstringop-overflow to diagnose provable buffer overflows, except with GCC == 11 which mishandles the test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=610347effc2ecb5ededf5037e82240b151f883ab For extra Linux warning flags W=1/2/3 available see: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/Makefile.extrawarn -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry