From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Alejandro R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Teaching C/C++ from Ada perspective? Date: Mon, 9 Jul 2018 11:04:06 +0200 Organization: A noiseless patient Spider Message-ID: References: <856189aa-fa00-4960-929e-174f352310ad@googlegroups.com> <2f5e4ce0-94e8-4b94-9da7-045ec90a9b22@googlegroups.com> <18554067-1382-4b43-a832-2d27aa5117d7@googlegroups.com> <8dc19505-b68a-403c-a164-f1de1864f3f1@googlegroups.com> <559657f8-bbf4-4a70-9449-f85bc98d6c6b@googlegroups.com> <590d4672-4aef-42a5-823c-57ccd291115a@googlegroups.com> <8de6b5ba-25ab-4d46-b80c-1544f43a9b05@googlegroups.com> <670baa25-a987-45a0-991f-ec3aa2878233@googlegroups.com> <6acaa855-2508-49cc-a03f-16c6e00c91da@googlegroups.com> <14a07cba-2883-41d1-8ac6-86c48129b990@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 9 Jul 2018 09:04:07 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="86d43fc52c6dcf35f6ab0994d8b03f81"; logging-data="14227"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1879lI5XWLCc4ghk1AExOfK" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Cancel-Lock: sha1:2EPcbevn/n/qg+b4IJd3CLavFoo= In-Reply-To: <14a07cba-2883-41d1-8ac6-86c48129b990@googlegroups.com> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:53741 Date: 2018-07-09T11:04:06+02:00 List-Id: On 08/07/2018 22:00, Maciej Sobczak wrote: >> I do agree, but GNAT has become quite good about warning of "can move >> with to body", > > It did not warn me with the trivial and obvious (empty P!) code example that I have presented. Is there some compiler switch that makes GNAT more sensitive to such abuses? This is what I'm using currently and it warns about all unneeded withs: for Switches ("ada") use ("-gnatVa", "-gnatwa", "-g", "-O2", "-gnato", "-fstack-check", "-gnata", "-gnat12"); It's only with Community 2018 that I've started seeing the "use clause has no effect".