Skip site navigation (1)Skip section navigation (2)
Date:      06 May 2002 01:27:08 -0700
From:      Max Okumoto <okumoto@ucsd.edu>
To:        The Anarcat <anarcat@anarcat.dyndns.org>
Cc:        libh@FreeBSD.ORG
Subject:   Re: cvs commit: libh/util check_guards
Message-ID:  <hfhelly943.fsf@multivac.sdsc.edu>
In-Reply-To: The Anarcat's message of "Sun, 5 May 2002 22:14:27 -0400"
References:  <200205040801.g4481NN60418@usw4.freebsd.org> <20020506021427.GF393@lenny.anarcat.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <anarcat@anarcat.dyndns.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?hfhelly943.fsf>