AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only

__TIMESTAMP__ on xlC v8.0 indicates last compilation, not last modification

  • 1.  __TIMESTAMP__ on xlC v8.0 indicates last compilation, not last modification

    Posted Wed June 10, 2009 06:05 AM

    Originally posted by: SystemAdmin


    Hi,
    Macros __TIMESTAMP__ should indicate the date and time when the source
    file was last modified.

    AIX ep5710g 3 5

    > xlC -qversion
    IBM XL C/C++ Enterprise Edition V8.0 for AIX
    Version: 08.00.0000.0014
    However on v8.0 actually __TIMESTAMP indicates the date and time when
    the source file was last compiled.


    foo.cpp
    #include <iostream>
    int main()
    {
    std::cout << __TIMESTAMP__ << std::endl;
    std::cout << __DATE__ << std::endl;
    std::cout << __TIME__ << std::endl;
    return 0;
    }

    foo.cpp
    > ls -l foo.cpp
    -rwxr----- 1 user cc 162 Jun 10 12:54 foo.cpp

    > xlC_r foo.cpp

    > ./a.out
    Wed Jun 10 12:55:48 2009
    Jun 10 2009
    12:55:48

    > ls -l foo.cpp
    -rwxr----- 1 user cc 162 Jun 10 12:54 foo.cpp

    > xlC_r foo.cpp

    > ./a.out
    Wed Jun 10 12:57:18 2009 // WRONG Last compilation, not modification
    Jun 10 2009
    12:57:18 // OK Last compilation

    Alex Vinokur
    #AIX-Forum