https://bugzilla.novell.com/show_bug.cgi?id=635351 https://bugzilla.novell.com/show_bug.cgi?id=635351#c0 Summary: __DATE__ , __TIME__ cpp macros and build-compare Classification: openSUSE Product: openSUSE 11.4 Version: Factory Platform: All OS/Version: Other Status: NEW Severity: Enhancement Priority: P5 - None Component: Basesystem AssignedTo: matz@novell.com ReportedBy: crrodriguez@novell.com QAContact: qa@suse.de Found By: Development Blocker: No Currently there are a lot of packages that get republished after running build-compare due to massive usage of preprocessor macros __DATE__ and __TIME__ The current solution is patching packages one by one, which is not very efficient. The alternatives are not that good either. a) We can let it as is b) we can build packages with -Wno-builtin-macro-redefined and redefine __TIME__ and __DATE__ unfortunately this switch not only silence warnings of those macros but also of __TIMESTAMP__,__FILE__, and __BASE_FILE__. certainly not what I expect. c) we can apply something like this to libcpp warning, I have not tested it, not sure it is correct, not even compiled it ! :-D Index: libcpp/macro.c =================================================================== --- libcpp/macro.c.orig 2010-04-06 13:56:00.000000000 +0200 +++ libcpp/macro.c 2010-08-28 23:54:52.501613000 +0200 @@ -237,6 +237,21 @@ _cpp_builtin_macro_text (cpp_reader *pfi if (tt != (time_t)-1 || errno == 0) tb = localtime (&tt); + if (getenv("SUSE_TIME_DATE")) { + cpp_buffer *pbuffer = cpp_get_buffer (pfile); + if (pbuffer) + { + struct _cpp_file *file = cpp_get_file (pbuffer); + if (file) + { + struct stat *st = _cpp_get_file_stat (file); + if (st) { + tb = localtime (&st->st_mtime); + } + } + } + } + if (tb) { pfile->date = _cpp_unaligned_alloc (pfile, .. So when SUSE_TIME_DATE enviroment variable is defined __DATE__ and __TIME__ take the values of the file modification instead of the file compilation time, this of couse is only export'ed during build... d) similar to the above, without enviroment variables but just emit a warning and catch it with some post build check.. cpp_errno (pfile, CPP_DL_WARNING, "Do not use __DATE__ or __TIME__ try __TIMESTAMP__ instead"); //with line numbers and so on, to make it very clear... Yup, I know it is non-standard, and/or crazy but it might help better than the current state. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.