From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1655 invoked by alias); 19 Dec 2012 11:25:11 -0000 Received: (qmail 1624 invoked by uid 22791); 19 Dec 2012 11:25:07 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.155) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Dec 2012 11:25:01 +0000 Received: from md16.u-strasbg.fr (md16.u-strasbg.fr [130.79.200.206]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id qBJBOwe5080267 for ; Wed, 19 Dec 2012 12:24:58 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms17.u-strasbg.fr [130.79.204.117]) by md16.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id qBJBOwJk027997 for ; Wed, 19 Dec 2012 12:24:58 +0100 (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id qBJBOvTY014292 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Wed, 19 Dec 2012 12:24:58 +0100 (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Subject: [RFC] Require extern modifier for function prototypes in headers. Date: Wed, 19 Dec 2012 11:25:00 -0000 Message-ID: <000001cddddb$7999a0a0$6ccce1e0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-12/txt/msg00693.txt.bz2 Following the discussion triggered by my latest RFA/OBVIOUS? email, Joel proposed that I added a change to GDB coding styles. Here it is. Currently you can use "extern" modifier or leave it out. Apparently it should make no difference for function prototypes, but I still find it strange to have all functions but one being declared with "extern", like in ui-file.h header. Comments mowt welcome, Pierre Muller GDB pascal language maintainer 2012-12-19 Pierre Muller * gdbint.texinfo (Function prototypes): Require use of "extern" modifier for function prototypes in headers. Index: gdbint.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v retrieving revision 1.344 diff -u -r1.344 gdbint.texinfo --- gdbint.texinfo 16 Dec 2012 19:00:04 -0000 1.344 +++ gdbint.texinfo 19 Dec 2012 11:19:40 -0000 @@ -5935,7 +5935,8 @@ function definition. All external functions should have a declaration in a header file that -callers include, except for @code{_initialize_*} functions, which must +callers include, that declaration should use the @code{extern} modifier. +The only exception concerns @code{_initialize_*} functions, which must be external so that @file{init.c} construction works, but shouldn't be visible to random source files.