From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from spam02.hesby.net (spam01.hesby.net [81.29.32.152]) by sourceware.org (Postfix) with ESMTP id 415433858C60 for ; Fri, 15 Oct 2021 15:50:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 415433858C60 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=hesbynett.no Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hesbynett.no Received: from [192.168.0.63] (unknown [79.161.10.130]) by spam02.hesby.net (Halon) with ESMTPSA id 932d89be-2dcf-11ec-8d7a-506b8dfa0e58; Fri, 15 Oct 2021 17:50:11 +0200 (CEST) Subject: Re: MISRA C To: Jonathan Wakely , Baraa Jarkas Cc: "gcc-help@gcc.gnu.org" References: From: David Brown Message-ID: Date: Fri, 15 Oct 2021 17:50:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3032.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 15 Oct 2021 15:50:15 -0000 On 13/10/2021 21:35, Jonathan Wakely via Gcc-help wrote: > On Wed, 13 Oct 2021 at 14:11, Baraa Jarkas via Gcc-help > wrote: >> >> Hi, >> >> I would like to know which Misra C Rules are supported by GCC compiler and if there is any document contains these informations. > > What do you mean by "supported"? > > Valid C code that follows MISRA rules can be compiled by GCC, but I > doubt that's what you mean. > > If you want something to check that the rules are followed, that's not > what GCC is for. GCC is a compiler. There are static analysis tools > that can check for conformance to guidelines like MISRA. > I find gcc very useful for static analysis too - much better than many commercial compilers that support MISRA rule checking. But many of the MISRA rules would be more suitable in a plugin, perhaps using David Malcolm's static analyser framework or his Python plugin. There's also the issue that MISRA is not free (it's cheap - £10, as far as I remember - but very far from "GPL free"). I don't know the licensing or copyright complications that might be involved in making a plugin that referenced rules in MISRA's guidelines.