This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Arithmetic type emulator helper class for testcases.


Hi,

> I like the simple-first approach :) Attached is an update
> (everything this time), note that I'm still just checking if any of
> clock_gettime(REAL/MONO) and gettimeofday compile regardless
> of _POSIX defn's. Is this ok if I do the _POSIX checks in <chrono> itself
> if the corresponding _GLIBXX is defined? I guess I'm assuming that
> the configure-time check is suppose to figure out which of clock
> func's are available for use and not just, "yes, at least one is
> available".

If we are following the "simple" scheme, then better following it fully and also having the configure test fail if the condition on _POSIX_TIMERS > 0 fails. More important, in case gettimeofday is selected, we have to actually include <sys/time.h> in the library. Well, actually I'm rather nervous about that, I think we should separate these basic system level facilities to a base class (or whatever you prefer) living in a .cc file: there you can play any trick with #ifdef and weird includes and whatever. (by the way, always remember to call the new test from configure.ac)

> Few other issues with system_clock in particular. The testcase
> in the patch is just using dg-compile because, at least on my system,
> clock_gettime is defined in librt.so and I wasn't sure if
> adding -lrt to the dg-options is sufficient. Is another configure-time
> check needed to determine if clock_gettime is in librt.so or not
> (I've seen a similar check done in other opensource projects)?

This is an important issue, not just a testing issue, because we are not ready in the library for an additional -lrt. I think that for the moment we should just change the configure checks to TRY_LINK and be prepared for the configure test failing completely, no facilities available at all (thus have the library compile anyway, just disable testcases, whatever). At some point we should work again on that, of course, we should have a way to use facilities in librt... Maybe Benjamin can comment on this general issue...

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]