[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference smurf::buildhelp

Title:USG buildhelp questions/answers
Moderator:SMURF::FILTER
Created:Mon Apr 26 1993
Last Modified:Mon Jan 20 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2763
Total number of notes:5802

2672.0. "re: bcreate header [for .c and .h files]" by AOSG::FILTER (Automatic Posting Software - mail to flume::puck) Thu Nov 14 1996 16:56

Date Of Receipt: 	14-NOV-1996 16:21:43.04
From: 	FLUME::jmf "Joshua M. Friedman Digital UNIX  14-Nov-1996 1617"
To: 	deeng@DEC:.zko.flume, buildhelp@DEC:.zko.flume
CC: 	schloss@DEC:.zko.flume
Subj: 	re: bcreate header [for .c and .h files]

Can anyone in DE-engineering or buildhelp please provide any feedback on
this?  Please cc buildhelp and schloss.

Thanks...		-josh


Mike, here's what I know about this:

In the DEC OSF/1 V3.0 release we changed the standard dataline used to
track revisions in .c sources and their objects from:

    static char *rcsid = "@(#)$RCSfile$ $Revision$ (DEC) $Date$";
to
    #pragma ident "@(#)$RCSfile$ $Revision$ (DEC) $Date$"

However it was up to developers to integrate this into the product.  I
believe there was a concerted effort in the kernel, and perhaps in some
other portions of the pool, to move this data from read-write to read-only
space.  New .c files would pick this up as well from the bcreate header
(/usr/sde/osf1/headers/header.c) file.  It may have been thought that over
time people would migrate the remaining parts of the pool as files were
touched.

The cpp man page includes the following entry; I haven't found any
reference to "#pragma ident" in our man pages or online books, but, since
#pragma is used for compiler specific options,  this leads me to think
that "#ident ..." and "#pragma ident ..." may be identical:

  #ident "string"
          This directive is transformed by the preprocessor into the form
          __pragma(6, "string").


Regarding actually defining values in .h files, rather than using
comments, I do not know what the technical feasibility of this is; I'll
leave that to feedback from the development environment folks.

Thanks...		-josh


------- Forwarded Message

To: odehelp
Subject: bcreate header
Date: Thu, 14 Nov 96 11:00:53 -0500
From: schloss
X-Mts: smtp

The bcreate command creates a default header for .h files
that leaves something to be desired.  The RCS ID string is
only available in a comment string.  This will not appear
in the compiled object.  Wouldn't it be better to use the
same header as for .c files?  This would allow someone to
verify that they don't have conflicting versions of a header
file, a common problem in a busy development environment.

Also, what is the difference between

	#pragma ident "foo"

and

	#ident "foo"

The kernel appears to use #pragma consistently where as
most of user space appears to use "#ident".  The bcreate
command now always generates #pragma.  What is the correct
procedure?

Mike Schloss

------- End of Forwarded Message


T.RTitleUserPersonal
Name
DateLines
2672.1Re: bcreate header [for .c and .h files]AOSG::FILTERAutomatic Posting Software - mail to flume::puckThu Nov 14 1996 17:5841
Date Of Receipt: 	14-NOV-1996 17:27:13.97
From: 	QUARRY::neth "Craig Neth USG  14-Nov-1996 1723"
To: 	"Joshua M. Friedman, Digital UNIX, 381-1548" <jmf@DEC:.zko.quarry>
CC: 	[email protected], buildhelp@DEC:.zko.quarry,
	schloss@DEC:.zko.quarry
Subj: 	Re: bcreate header [for .c and .h files]

>Also, what is the difference between
>
>	#pragma ident "foo"
>
>and
>
>	#ident "foo"

Functionally, I do not belive there is any difference - both strings end
up in the .rdata (read only data) section.

I think #pragma ident is preferred as it is ANSI standard conforming - pragmas
are reserved for definition by implementations, and if a compiler does not
understand a pragma it is to ignore it.    I don't know the history on #ident
to know why the kernel seems to use it vs. #pragma ident.

Incidentally, the de group has a 'wishlist' item to improve the handling of
#pragma ident to have the ident strings put in the .comment section, so
that these strings won't consume memory at runtime.

As far as the header file stuff - I don't think you want to put #pragma
ident in header files - it would mean that you would get a string contributed
from every header file you included in every .o file.    I think we would
see a large increase in the datasize of our images if we did that.

I'm not sure I see how the verification of conflicting headers would work -
can you elaborate on that?

Craig





2672.2Re: bcreate header [for .c and .h files]AOSG::FILTERAutomatic Posting Software - mail to flume::puckThu Nov 14 1996 17:5932
Date Of Receipt: 	14-NOV-1996 17:49:05.63
From: 	FLUME::schloss "Mike Schloss usg  14-Nov-1996 1745"
To: 	"Craig Neth DTN 381-2174" <neth@DEC:.zko.flume>
CC: 	jmf@DEC:.zko.flume, deeng@DEC:.zko.flume, buildhelp@DEC:.zko.flume
Subj: 	Re: bcreate header [for .c and .h files]

> As far as the header file stuff - I don't think you want to put #pragma
> ident in header files - it would mean that you would get a string contributed
> from every header file you included in every .o file.    I think we would
> see a large increase in the datasize of our images if we did that.

Each string is only about 80 bytes.  You would increase the size of each
binary by one 8K page for every 100 strings.  Do you really think that this
will make that big of a difference?

> I'm not sure I see how the verification of conflicting headers would work -
> can you elaborate on that?

Sure, file foo.c include files frobnitz.h.  Library routine frobnitz() is
in frobnitz.c which also includes frobnitz.h.  When you build executable
foo you get the latest version of frobnitz.h (say version 8.8).  But static
library frobnitz.a which has not been recompiled in quite a while used
version 4.4 of frobnitz.h.  Now you can do something like:

% what foo | grep frobnitz.h
	frobnitz.h	version 4.4
	frobnitz.h	version 8.8

Something similar could also be done for shared libraries.

Mike

2672.3Re: bcreate header [for .c and .h files]AOSG::FILTERAutomatic Posting Software - mail to flume::puckFri Nov 15 1996 13:1228
Date Of Receipt: 	15-NOV-1996 12:50:02.22
From: 	QUARRY::neth "Craig Neth USG  15-Nov-1996 1246"
To: 	Mike Schloss usg <schloss@DEC:.zko.quarry>
CC: 	jmf@DEC:.zko.quarry, [email protected], buildhelp@DEC:.zko.quarry
Subj: 	Re: bcreate header [for .c and .h files]

>Each string is only about 80 bytes.  You would increase the size of each
>binary by one 8K page for every 100 strings.  Do you really think that this
>will make that big of a difference?

Not just the binary, but the datasize usage of each binary also.  That means
memory (It will be shared by all users of the system, but it will still be
one more page of data...)   

If the ident stuff went in the .comment section (which is never loaded into
memory) it might make sense, but I don't think we can afford it with the
current implementation.   

> Now you can do something like:
>
>% what foo | grep frobnitz.h

Sure.  I was thinking that you had some automatic method in mind - I was
having troubles imagining how that would work.

Craig