Next: , Previous: Specific Compiler Characteristics, Up: Compilers and Preprocessors


5.10.2 Generic Compiler Characteristics

— Macro: AC_CHECK_SIZEOF (type, [unused], [includes = `default-includes'])

Define SIZEOF_type (see Standard Symbols) to be the size in bytes of type. If `type' is unknown, it gets a size of 0. If no includes are specified, the default includes are used (see Default Includes).

This macro now works even when cross-compiling. The unused argument was used when cross-compiling.

For example, the call

          AC_CHECK_SIZEOF([int *])
     

defines SIZEOF_INT_P to be 8 on DEC Alpha AXP systems.

— Macro: AC_CHECK_ALIGNOF (type, [includes = `default-includes'])

Define ALIGNOF_type (see Standard Symbols) to be the alignment in bytes of type. If `type' is unknown, it gets a size of 0. If no includes are specified, the default includes are used (see Default Includes).

— Macro: AC_COMPUTE_INT (var, expression, [includes = `default-includes'], [action-if-fails])

Store into the shell variable var the value of the integer expression. The value should fit in an initializer in a C variable of type signed long. To support cross compilation (in which case, the macro only works on hosts that use twos-complement arithmetic), it should be possible to evaluate the expression at compile-time. If no includes are specified, the default includes are used (see Default Includes).

Execute action-if-fails if the value cannot be determined correctly.

— Macro: AC_LANG_WERROR

Normally Autoconf ignores warnings generated by the compiler, linker, and preprocessor. If this macro is used, warnings count as fatal errors for the current language. This macro is useful when the results of configuration are used where warnings are unacceptable; for instance, if parts of a program are built with the GCC -Werror option. If the whole program is built using -Werror it is often simpler to put -Werror in the compiler flags (CFLAGS, etc.).