Re: Add compiled date to git --version output?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Sep 18, 2009, at 12:17 AM, Nazri Ramliy wrote:

+       printf("git version %s compiled %s %s\n",
+                       git_version_string,
+                       __DATE__,
+                       __TIME__);

Thoughts?

Any idea how compatible that is? Sure, it'll work with GCC's cpp, but we try to work with a huge variety of compilers.

At the very least you might want to wrap it all in #ifdefs or something:

#if defined(__DATE__) && defined(__TIME__)
/* your version */
#else
/* old version */
#endif

(Or play fun tricks with #ifndef ... #define, but then you also have to play with the format string or something.)

~~Brian
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]