public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Compilation time/date
@ 2000-09-18 15:26 Ovanes Manucharyan
  0 siblings, 0 replies; 2+ messages in thread
From: Ovanes Manucharyan @ 2000-09-18 15:26 UTC (permalink / raw)
  To: gcc

Hi,

I am aware that binaries compiled using HP's ACC
compiler have the compilation date/time embedded in
them.

Is that true with GCC? If so, how can I decode that
information? What kind of a data structure houses such
information. And is this information, compilation
date/time, kept in a standardized manner or does it
vary from compiler to compiler?

Sincerely,

Ovanes Manucharyan

P.S. I believe this is the right mailing list for this
question, however, if its not, then I would appreciate
if someone could direct me to the proper list.

__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Compilation time/date
@ 2000-09-18 17:17 Mike Stump
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Stump @ 2000-09-18 17:17 UTC (permalink / raw)
  To: gcc, ovanes_m

> Date: Mon, 18 Sep 2000 15:26:35 -0700 (PDT)
> From: Ovanes Manucharyan <ovanes_m@yahoo.com>
> To: gcc@gcc.gnu.org

> I am aware that binaries compiled using HP's ACC compiler have the
> compilation date/time embedded in them.

This is generally considered to be a non-feature.

> What kind of a data structure houses such information. And is this
> information, compilation date/time, kept in a standardized manner or
> does it vary from compiler to compiler?

It varies from OS to OS, more than anything.  You can access the file
modification time, this will have date of last modification.  If one
uses cp -p and other such methods to make copies, then the time on the
file, will be the time when it was compiled.  I'd recommend that.
After that, you can record that time and date anyplace you want during
compilation, and use that information.  For example:

file.c:

	char time_and_date[] = foo(__TIME__, __DATE__);

and then you can get at it via time_and_date.  Or, you can log it to a
data file during the build, and store it someplace else...

Lots of possibilities.  For more information on any OS specific time
and date built in, a better place to ask would be to ask on a OS
specific list.  You can find out what you system does, by compiling:

int main() { return 0; }

twice, at least a second or so apart, and seeing if the two binaries
differ.  If they do, then the difference is probably due to the time
and date.  If you run od -x on the two, you can probably reverse
engineer it, if you can't find the information someplace.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-09-18 17:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-18 15:26 Compilation time/date Ovanes Manucharyan
2000-09-18 17:17 Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).