[GiNaC-devel] Patch 4

Alexei Sheplyakov alexei.sheplyakov at gmail.com
Thu Sep 9 18:01:38 CEST 2010


Hi,

> if we use the AC_CHECK_ALIGNOF method, wouldn't that have the advantage
> that any future changes in MSVC behaviour (or any other compiler) would
> be dealt with by the autoconf maintainers?

In general I try to avoid using AC_CHECK_* things for computing compile-time
constants (like sizeof(foo), __alignof__(foo), etc). auto* tools
regenerate config.h
way too often, and that results in spurious recompilations. This is
not a problem
for users, but for it creates additional problems for developers. I
mean, when you
trying to find out which commit introduced a regression (say, with git
bisect), you
check out particular version and recompile the thing. auto* tools see
the timestamps
changed => re-generates Makefiles and config.h => and all files which
#include config.h
need to be recompiled => waste of time.Therefore I don't quite like
AC_CHECK_ALIGNOF
thing.

> Otherwise someone would have to change compiler.h manually every time.

I don't think such changes happen often. As a matter of fact, __alignof__ works
just fine with GCC versions 3.4 through 4.5, i.e. there were no
changes in 6 years.
Let's hope that ms authors are smart enough to not introduce
backward-incompatible
changes for no good reason, and use #define instead of autoconf macro.

As a last resort we can define alignof<T> template (a la boost).

Best regards,
        Alexei


More information about the GiNaC-devel mailing list