Closed
Description
Bugzilla Link | 10207 |
Resolution | DUPLICATE |
Resolved on | Jun 27, 2011 18:20 |
Version | trunk |
OS | Linux |
Attachments | configure check |
Reporter | LLVM Bugzilla Contributor |
CC | @efriedma-quic |
Extended Description
the btowc.m4 check generated from gnulib's gl_FUNC_BTOWC looks like this:
<<<SNIP
#include <string.h>
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
included before <wchar.h>. */
#include <stddef.h>
#include <stdio.h>
#include <time.h>
#include <wchar.h>
int main ()
{
if (btowc ('\0') != 0)
return 1;
return 0;
}
<<<SNIP
If I compile this with gcc and run it, it returns as expected (even with -O3).
It compiles and returns when run as well for clang with -O0 and -O1.
It hangs for clang -O2 and -O3.
This on linux 2.6.39.2 with clang 3.0 git-6594942e98e25640f226aba622eb76bcaf0a521c.