[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Configure check for static_cast is broken
From: |
Dmitri Gribenko |
Subject: |
Re: Configure check for static_cast is broken |
Date: |
Wed, 10 Apr 2013 18:50:00 +0300 |
On Wed, Apr 10, 2013 at 6:46 PM, Dmitri Gribenko <address@hidden> wrote:
> Dear ncurses maintainers,
>
> Configure fails to detect that clang 3.2 fully supports a c++98
> feature -- static_cast because the code that it uses to check this is
> not valid c++.
Unfortunately, this is not all. Similarly, check for size of bool is broken:
configure:18808: checking for size of bool
configure:18861: clang++ -o conftest -fPIC -O2 -march=native
-I/opt/eb/software/OpenBLAS/0.2.6-cgompi-1.1.6-LAPACK-3.4.2/include
-I/opt/eb/software/ScaLAPACK/2.0.2-cgompi-1.1.6-OpenBLAS-0.2.6-LAPACK-3.4.2/include
-I/opt/eb/software/FFTW/3.3.3-cgompi-1.1.6/include -D_GNU_SOURCE
-DNDEBUG -L/opt/eb/software/GCC/4.7.2/lib64
-L/opt/eb/software/OpenBLAS/0.2.6-cgompi-1.1.6-LAPACK-3.4.2/lib
-L/opt/eb/software/ScaLAPACK/2.0.2-cgompi-1.1.6-OpenBLAS-0.2.6-LAPACK-3.4.2/lib
-L/opt/eb/software/FFTW/3.3.3-cgompi-1.1.6/lib conftest.cc -lm
-lpthread >&5
configure:18842:1: error: C++ requires a type specifier for all declarations
main()
^~~~
1 error generated.
configure:18864: $? = 1
configure: program exited with status 1
configure: failed program was:
#line 18819 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdio.h>
#if defined(__cplusplus)
#ifdef HAVE_GXX_BUILTIN_H
#include <g++/builtin.h>
#elif HAVE_GPP_BUILTIN_H
#include <gpp/builtin.h>
#elif HAVE_BUILTIN_H
#include <builtin.h>
#endif
#else
#if 1
#include <stdbool.h>
#endif
#endif
main()
{
FILE *fp = fopen("cf_test.out", "w");
if (fp != 0) {
bool x = true;
if ((bool)(-x) >= 0)
fputs("unsigned ", fp);
if (sizeof(x) == sizeof(int)) fputs("int", fp);
else if (sizeof(x) == sizeof(char)) fputs("char", fp);
else if (sizeof(x) == sizeof(short))fputs("short",fp);
else if (sizeof(x) == sizeof(long)) fputs("long", fp);
fclose(fp);
}
return(0);
}
configure:18887: result: unknown
configure:18893: WARNING: Assuming unsigned for type of bool
To resolve this, just declare main as 'int main()'.
Dmitri
--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <address@hidden>*/