libFLAC/stream_decoder.c: fix integer overflow on corrupt file
[flac.git] / m4 / clang.m4
blob036f0e684e60656b033eceb2250774ae6ea3e190
1 dnl @synopsis XIPH_C_COMPILER_IS_CLANG
2 dnl
3 dnl Find out if a compiler claiming to be gcc really is gcc (clang lies).
4 dnl @version 1.0        Oct 31 2013
5 dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
6 dnl
7 dnl Permission to use, copy, modify, distribute, and sell this file for any
8 dnl purpose is hereby granted without fee, provided that the above copyright
9 dnl and this permission notice appear in all copies.  No representations are
10 dnl made about the suitability of this software for any purpose.  It is
11 dnl provided "as is" without express or implied warranty.
12 dnl
15 AC_DEFUN([XIPH_C_COMPILER_IS_CLANG],
16 [AC_CACHE_CHECK(whether we are using the CLANG C compiler,
17         xiph_cv_c_compiler_clang,
18         [       AC_LANG_ASSERT(C)
19                 AC_TRY_LINK([
20                         #include <stdio.h>
21                         ],
22                         [
23                         #ifndef __clang__
24                                 This is not clang!
25                         #endif
26                         ],
27                 xiph_cv_c_compiler_clang=yes,
28                 xiph_cv_c_compiler_clang=no
29                 ])
30         )]