From owner-freebsd-libh Mon May 6 1:27:15 2002 Delivered-To: freebsd-libh@freebsd.org Received: from postal.sdsc.edu (postal.sdsc.edu [132.249.20.114]) by hub.freebsd.org (Postfix) with ESMTP id 29AFD37B404 for ; Mon, 6 May 2002 01:27:12 -0700 (PDT) Received: from multivac.sdsc.edu (multivac.sdsc.edu [132.249.20.57]) by postal.sdsc.edu (8.11.6/8.11.6/server/38) with ESMTP id g468R8n28101; Mon, 6 May 2002 01:27:08 -0700 (PDT) Received: by multivac (8.11.6+Sun/1.11-SolarisClient) id g468R8E24698; Mon, 6 May 2002 01:27:08 -0700 (PDT) To: The Anarcat Cc: libh@FreeBSD.ORG Subject: Re: cvs commit: libh/util check_guards References: <200205040801.g4481NN60418@usw4.freebsd.org> <20020506021427.GF393@lenny.anarcat.dyndns.org> From: Max Okumoto Date: 06 May 2002 01:27:08 -0700 In-Reply-To: The Anarcat's message of "Sun, 5 May 2002 22:14:27 -0400" Message-ID: Lines: 46 X-Mailer: Gnus v5.5/XEmacs 20.4 - "Emerald" Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In previous projects that I have worked on the people have created header files by coping old header files. When using guards, it is really hard to trace down when someone forgets to update the tag. So I wrote this to scan the headers and create tags from the names of the files. The script would just replace any tag that was already protecting the file. If and only if three tags in the guard matched. Bar.hh -> Bar_hh On really large projects different programmers have named files with the same name. They are in different lib hence had different paths. So I added protection by adding the md5 include/Dance/Bar.hh -> Bar_hh_a6507158 include/Sing/Bar.hh -> Bar_hh_12343435 Thus if a file musical.cc had the following includes #include "Dance/Bar.hh" #include "Sing/Bar.hh" The two header files would not exclude the other if the tag was only Bar_hh. Max Okumoto The Anarcat writes: > I'm not sure I understand what this script does. > > Does it force a given file.hh to have header guards like: > > #ifndef FILE_HH > #define FILE_HH > /* c code here */ > #endif > > in other words, what is the format of the XXXX in your commit log? > > I'm not sure that an additional md5 suffix is necessary. There > shouldn't be similar header file names. Anyways, with the compile dir > scheme if there's files with identical file names, they're going to > make a mess in the compile directories. > > A. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message