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). If you provide include, be sure to include stdio.h which is required for this macro to run.

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). If you provide include, be sure to include stddef.h and stdio.h which are required for this macro to work 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.).