Re: cvs commit: libh/util check_guards

Max Okumoto <[email protected]>
Newsgroups gmane.os.freebsd.devel.libh
Message-ID <[email protected]>
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 <[email protected]> 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 [email protected]
with "unsubscribe freebsd-libh" in the body of the message
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.