[cfe-dev] Is this a bug?

Devchandra L Meetei dlmeetei at gmail.com
Mon Jul 2 00:05:07 PDT 2012


The following simple test

#include<iostream>
#include<cstdio>
#include<cstdint>
using namespace std;

int main()
{
    int16_t b = 20;
    printf("%d\n", b);
}

when complied with

>[deleisha at deleisha mytestcode]$ clang++ --version
>clang version 3.0 (tags/RELEASE_30/final)
>Target: x86_64-unknown-linux-gnu
>Thread model: posix
>[deleisha at deleisha mytestcode]$

produces

[deleisha at deleisha mytestcode]$ clang++ stdint_test.cpp
In  file included from stdint_test.cpp:3:
In file included from
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cstdint:34:
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/c++0x_warning.h:31:2:
error: #error This file requires compiler and library support for the
upcoming ISO C++ standard, C++0x.
      This support is currently experimental, and must be enabled with the
-std=c++0x or -std=gnu++0x compiler options.
*#error This file requires compiler and library support for the upcoming \*
 ^
1 error generated.
[deleisha at deleisha mytestcode]$

telling that c++0x must be enabled.

gcc gives same thing

>[deleisha at deleisha mytestcode]$ g++ stdint_test.cpp
>In file included from
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cstdint:35,
 >                from stdint_test.cpp:3:
>/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/c++0x_warning.h:31:2:
error: #error This file requires compiler and library support for the
upcoming ISO C++ standard, C++0x. This support is currently >experimental,
and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
>[deleisha at deleisha mytestcode]$


May  be this is because, in my setup, clang is using gcc headers, but
clang++ 's* *(#error line in italics above) is confusing.

BUT my major worry is that, I am hoping that stdint.h are part c99 std. So
is warning seems to irrelevant.
Any explanation would help.

Regards
--Dev
*
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120702/ef0f157c/attachment.html>


More information about the cfe-dev mailing list