[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Make 3.79.1 on OpenVMS
From: |
Henning Makholm |
Subject: |
Re: Make 3.79.1 on OpenVMS |
Date: |
27 Sep 2002 22:52:56 +0200 |
Scripsit "Paul D. Smith" <address@hidden>
> %% address@hidden (Paul Jarc) writes:
> pj> "Paul D. Smith" <address@hidden> wrote:
> >> Hm. However, I can't think of any way to write a configure test on
> >> whether or not time_t is signed or unsigned.
> pj> if ((time_t)-1<(time_t)0) signed(); else unsigned();
> Not bad but this requires being able to run a program. This is a no-no
> if you want your app to be cross-compilable.
How about trying to just compile this source file:
#include <time.h>
#define IS_SIGNED ((time_t)-1 < (time_t)0)
int foo [ 1 - 2*IS_SIGNED ] = { 42 };
If time_t is signed, the C compiler ought to refuse to compile it
because the array bound will be negative.
Of course it won't help in environments where the compiler returns no
useful success/failure state to the configure scripts. But in such
an environment even the vanilla autoconf tests will have trouble.
--
Henning Makholm "First chapter, the plot advances,
second chapter, Ayla makes a discovery that
significantly enhances Palaeolithic technology, third
chapter, Ayla has sex with someone, and repeat ad infinitum."