From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.perfora.net (mout.perfora.net [74.208.4.197]) by sourceware.org (Postfix) with ESMTPS id 8A0953938C35 for ; Fri, 1 May 2020 17:13:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8A0953938C35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesniffer.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nospam@codesniffer.com Received: from oxuslxaltgw07.schlund.de ([10.72.76.63]) by mrelay.perfora.net (mreueus003 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MOgoS-1jYPFk0Aj8-006AtZ; Fri, 01 May 2020 19:13:38 +0200 Date: Fri, 1 May 2020 13:13:37 -0400 (EDT) From: Tom N Reply-To: Tom N To: Jonathan Wakely Cc: gcc-help Message-ID: <31960797.205994.1588353217751@email.ionos.com> In-Reply-To: References: <705810366.188410.1588278611012@email.ionos.com> <1924531380.192357.1588287485150@email.ionos.com> Subject: Re: -fsanitize=undefined behavior MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_205993_1983923320.1588353217751" X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.1-Rev30 X-Originating-Client: open-xchange-appsuite X-Provags-ID: V03:K1:thNILLXEUbr2GnT/5iHZm9Xugb/ej8GwA54aT2LAa/0VYeLly9+ qR30O60ed2YmS8Mp9hJDnQjXcn4nIG1o62JhzKfc4dlTds9iVSzpgAiC8MkLpMScFh3+yVp BjiBSfo5s6Xw1DdxubaQBCxpXaQIq2yFtDzTtddGcRwkvtdg1x9NzbpXqQwnoi9g99hHLqh UrtrgKXGGWBePanhi6KPQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:rRoqkuX4SdE=:q6GNCbC+cO+viFesndRtrn 2Xe0LEoF2e80GgNSLvfk+AekTKRdG3lSGLD2ig+SUdpK1e9roIPlhmbM7MAhBfIfMLhfQsyMC G6FuNqFeNh2UfBxm0lFHYD8ieKbfiyYuiv419EC1G2u2/GaGf7rnfAi7nJSiuHQFxxippN/El Xt/lV/Pbuwie8nFXHVP2Q+l0EOtgbcmtYm/aV+mB7+l5XRp3Our0Kx7udpcTqfH8ra6LX7jLQ 3AesK4zSce/HgPm3KDc7hwpzUbCLdXtQZjs36gERZI70iiPJPkpVWhgExZA9VayDsRO/hUeA+ mUmb9B32xEMLa+UANUGBAcZOxrZ89Wl6a49yDT68CSZ/ERPUWtNWLYK5iN+7RthgBnodooPog YYRrk9KJvO+UEeDSBTxEnVgirwzRcbthI6/DFGZkILHy7Y3kFAm+WB8lP+hV8G+9jqAvJbc8y KIjMbgqEle7JVNahBPY4PH4Or239v+Zt7mcXUeGpgebGXR6blNjTPCfgr72QoTagqR77tMUNS 0HzMByUrcBGB+JaJlNmeX6ZZU0joALLwQE/RpuWc5Q3z+NyYL1z4RtqteRqdceVYOvdqFyjfd S2u0qiMBwhFZReHD90SJYDn5/2M+BeLfMyEbjZDRH7KGMu1a0XN/GtOUVbYVRvOhBdiB1fqAU hL9K1oSqJ3EQBdRBSjTkc0bq+f5lpNHF4T0dguBpFHkw6jI7AVcigvt9Rdkvzz2GWbkMz+Ich b3XAVryoQ5Pcj7gmNXJt6Up80xd8w/rxh5tRU1Vyc9FG3lbPVOfgZQBJBvyMVe0X2JfWINEMe 4RqA1yQvh+55UbNNKWJBMVW+CgAJsTbVgRrJEZdzxqCe5DJpOCqwomm69FZbYTv6uNm9b+J X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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: Fri, 01 May 2020 17:13:41 -0000 ------=_Part_205993_1983923320.1588353217751 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit > On May 1, 2020 at 7:39 AM Jonathan Wakely wrote: > > On Thu, 30 Apr 2020 at 23:58, Tom N wrote:>> > On April 30, 2020 at 5:57 PM Jonathan Wakely wrote:The man page says:"Unlike other similar options, -fsanitize=float-divide-by-zero is not enabled by -fsanitize=undefined" and "Unlike other similar options,-fsanitize=float-cast-overflow is not enabled by -fsanitize=undefined"So it seems reasonable to assume that all the other suboptions are enabled by -fsanitize=undefined, and if you want *all* of them then use -fsanitize=undefined -fsanitize=float-divide-by-zero-fsanitize=float-cast-overflow> Thanks for the tip. Any reason the description of -fsanitize=undefined doesn't include something like, "If the -fsanitize=undefined option is enabled all sub-options will be enabled unless otherwise specified." so it's clear?Probably because nobody has suggested doing that yet. Would you liketo propose a patch for the docs? > The relevant place is here:https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/doc/invoke.texi;h=527d362533ab503cee9568b27808177977a52ac8;hb=HEAD#l13541 I'd be happy to but unfortunately I'm not familiar with git. (I know...). But here's an old-style patch off 8.4 if it helps (attached too): ----- --- gcc-8.4.0/gcc/doc/invoke.texi 2020-03-04 03:30:00.000000000 -0500 +++ gcc-8.4.0_new/gcc/doc/invoke.texi 2020-05-01 13:10:36.517390533 -0400 @@ -11404,7 +11404,8 @@ @opindex fsanitize=undefined Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector. Various computations are instrumented to detect undefined behavior -at runtime. Current suboptions are: +at runtime. If this option is enabled all sub-options listed below will be +enabled unless otherwise specified. Current suboptions are: @table @gcctabopt ----- ------=_Part_205993_1983923320.1588353217751 Content-Type: text/x-patch; charset=ISO-8859-1; name=sanitize_undefined_elaboration_gcc8.4.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=sanitize_undefined_elaboration_gcc8.4.patch X-Part-Id: 0dc4d84908234fec9d6b88afe302f7dc LS0tIGdjYy04LjQuMC9nY2MvZG9jL2ludm9rZS50ZXhpCTIwMjAtMDMtMDQgMDM6MzA6MDAuMDAw MDAwMDAwIC0wNTAwCisrKyBnY2MtOC40LjBfbmV3L2djYy9kb2MvaW52b2tlLnRleGkJMjAyMC0w NS0wMSAxMzoxMDozNi41MTczOTA1MzMgLTA0MDAKQEAgLTExNDA0LDcgKzExNDA0LDggQEAKIEBv cGluZGV4IGZzYW5pdGl6ZT11bmRlZmluZWQKIEVuYWJsZSBVbmRlZmluZWRCZWhhdmlvclNhbml0 aXplciwgYSBmYXN0IHVuZGVmaW5lZCBiZWhhdmlvciBkZXRlY3Rvci4KIFZhcmlvdXMgY29tcHV0 YXRpb25zIGFyZSBpbnN0cnVtZW50ZWQgdG8gZGV0ZWN0IHVuZGVmaW5lZCBiZWhhdmlvcgotYXQg cnVudGltZS4gIEN1cnJlbnQgc3Vib3B0aW9ucyBhcmU6CithdCBydW50aW1lLiAgSWYgdGhpcyBv cHRpb24gaXMgZW5hYmxlZCBhbGwgc3ViLW9wdGlvbnMgbGlzdGVkIGJlbG93IHdpbGwgYmUKK2Vu YWJsZWQgdW5sZXNzIG90aGVyd2lzZSBzcGVjaWZpZWQuIEN1cnJlbnQgc3Vib3B0aW9ucyBhcmU6 CiAKIEB0YWJsZSBAZ2NjdGFib3B0CiAK ------=_Part_205993_1983923320.1588353217751--