From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C56AC433E0 for ; Sun, 31 May 2020 00:38:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE2492074D for ; Sun, 31 May 2020 00:38:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="0e2QjDN/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729531AbgEaAi1 (ORCPT ); Sat, 30 May 2020 20:38:27 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:58852 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729361AbgEaAi0 (ORCPT ); Sat, 30 May 2020 20:38:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=e9QIUdzd+iWIilrtCZ9ZBugPzhUA+6l2fFpJzvxDvH4=; b=0e2QjDN/lALeQ1lOnuUTCbBUoO Fm2v65fWeJYFKPm24HxbHM8aOlsBwoPR5BePSxCfG+Xz24zmwEqxGNefTHarKVLjGlR5U8d+rniUp SgTEC5FopK8ZuJwHC2Ws906OdpBLRo+a5DWKRkt7qdcqv/PYBSj8thstE3dQCLMaNz1Y=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1jfBzZ-003lZ0-St; Sun, 31 May 2020 02:38:21 +0200 Date: Sun, 31 May 2020 02:38:21 +0200 From: Andrew Lunn To: Vladimir Oltean Cc: f.fainelli@gmail.com, vivien.didelot@gmail.com, davem@davemloft.net, netdev@vger.kernel.org Subject: Re: [PATCH net-next 1/2] net: dsa: sja1105: suppress -Wmissing-prototypes in sja1105_static_config.c Message-ID: <20200531003821.GA897737@lunn.ch> References: <20200530102953.692780-1-olteanv@gmail.com> <20200530102953.692780-2-olteanv@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200530102953.692780-2-olteanv@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sat, May 30, 2020 at 01:29:52PM +0300, Vladimir Oltean wrote: > From: Vladimir Oltean > > Newer compilers complain with W=1 builds that there are non-static > functions defined in sja1105_static_config.c that don't have a > prototype, because their prototype is defined in sja1105.h which this > translation unit does not include. > > I don't entirely understand what is the point of these warnings, since > in principle there's nothing wrong with that. Hi Vladimir The issue here is that the header might have a typo and have a different signature than the function itself. The caller than passes the parameters in the wrong way. Best case it segfault/Opps, but it can introduce subtle bugs which are hard to find. Andrew