http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50944
Bug #: 50944 Summary: gcc-4.6.x regression with complex.h on i386-pc-solaris2.10 Classification: Unclassified Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassig...@gcc.gnu.org ReportedBy: mariah.le...@gmail.com This is reopening #48949 which got closed. % gcc -c foo.c foo.c: In function 'foo': foo.c:5:11: error: '_Imaginary_I' undeclared (first use in this function) foo.c:5:11: note: each undeclared identifier is reported only once for each function it appears in % % gcc-4.5.1 -c foo.c % % gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/gcc-4.6.1/sparc-SunOS-ultrasparc3/libexec/gcc/sparc-sun-solaris2.10/4.6.1/lto-wrapper Target: sparc-sun-solaris2.10 Configured with: /usr/local/gcc-4.6.1/src/gcc-4.6.1/configure --enable-languages=c,c++,fortran --with-gnu-as --with-as=/usr/local/binutils-2.20.1/sparc-SunOS-ultrasparc3-gcc-4.4.3/bin/as --with-gnu-ld --with-ld=/usr/local/binutils-2.20.1/sparc-SunOS-ultrasparc3-gcc-4.4.3/bin/ld --with-gmp=/usr/local/mpir-2.4.0/sparc-SunOS-ultrasparc3-gcc-4.6.0-abi32 --with-mpfr=/usr/local/mpfr-3.0.1/sparc-SunOS-ultrasparc3-mpir-2.4.0-gcc-4.6.0-abi32 --with-mpc=/usr/local/mpc-0.9/sparc-SunOS-ultrasparc3-mpir-2.4.0-mpfr-3.0.1-gcc-4.5.1-abi32 --prefix=/usr/local/gcc-4.6.1/sparc-SunOS-ultrasparc3 Thread model: posix gcc version 4.6.1 (GCC) % % cat foo.c #include <complex.h> double _Complex foo () { return I; } % % gcc -E foo.c | grep complex.h # 1 "/usr/include/complex.h" 1 3 4 # 9 "/usr/include/complex.h" 3 4 #pragma ident "@(#)complex.h 1.9 04/10/23 SMI" # 24 "/usr/include/complex.h" 3 4 # 61 "/usr/include/complex.h" 3 4 # 61 "/usr/include/complex.h" 3 4 % % diff /usr/include/complex.h /usr/local/gcc-4.6.1/sparc-SunOS-ultrasparc3/inclu de/c++/4.6.1/complex.h 1,4c1 < /* < * Copyright 2004 Sun Microsystems, Inc. All rights reserved. < * Use is subject to license terms. < */ --- > // -*- C++ -*- compatibility header. 6,7c3,9 < #ifndef _COMPLEX_H < #define _COMPLEX_H --- > // Copyright (C) 2007, 2009 Free Software Foundation, Inc. > // > // This file is part of the GNU ISO C++ Library. This library is free > // software; you can redistribute it and/or modify it under the > // terms of the GNU General Public License as published by the > // Free Software Foundation; either version 3, or (at your option) > // any later version. 9c11,14 < #pragma ident "@(#)complex.h 1.9 04/10/23 SMI" --- > // This library is distributed in the hope that it will be useful, > // but WITHOUT ANY WARRANTY; without even the implied warranty of > // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > // GNU General Public License for more details. 11c16,18 < #if !defined(__cplusplus) --- > // Under Section 7 of GPL version 3, you are granted additional > // permissions described in the GCC Runtime Library Exception, version > // 3.1, as published by the Free Software Foundation. 13,15c20,26 < /* < * Compilation environments for Solaris must provide the _Imaginary datatype < * and the compiler intrinsics _Complex_I and _Imaginary_I --- > // You should have received a copy of the GNU General Public License and > // a copy of the GCC Runtime Library Exception along with this program; > // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see > // <http://www.gnu.org/licenses/>. > > /** @file complex.h > * This is a Standard C++ Library header. 17,22d27 < #define _Complex_I _Complex_I < #define complex _Complex < #define _Imaginary_I _Imaginary_I < #define imaginary _Imaginary < #undef I < #define I _Imaginary_I 24,45c29 < extern float cabsf(float complex); < extern float cargf(float complex); < extern float cimagf(float complex); < extern float crealf(float complex); < extern float complex cacosf(float complex); < extern float complex cacoshf(float complex); < extern float complex casinf(float complex); < extern float complex casinhf(float complex); < extern float complex catanf(float complex); < extern float complex catanhf(float complex); < extern float complex ccosf(float complex); < extern float complex ccoshf(float complex); < extern float complex cexpf(float complex); < extern float complex clogf(float complex); < extern float complex conjf(float complex); < extern float complex cpowf(float complex, float complex); < extern float complex cprojf(float complex); < extern float complex csinf(float complex); < extern float complex csinhf(float complex); < extern float complex csqrtf(float complex); < extern float complex ctanf(float complex); < extern float complex ctanhf(float complex); --- > #include <bits/c++config.h> 47,61c31,32 < extern double cabs(double complex); < extern double carg(double complex); < extern double cimag(double complex); < extern double creal(double complex); < extern double complex cacos(double complex); < extern double complex cacosh(double complex); < extern double complex casin(double complex); < extern double complex casinh(double complex); < extern double complex catan(double complex); < extern double complex catanh(double complex); < extern double complex ccos(double complex); < extern double complex ccosh(double complex); < extern double complex cexp(double complex); < #if defined(__PRAGMA_REDEFINE_EXTNAME) < #pragma redefine_extname clog __clog --- > #ifdef __GXX_EXPERIMENTAL_CXX0X__ > # include <ccomplex> 63,64c34,36 < #undef clog < #define clog __clog --- > # if _GLIBCXX_HAVE_COMPLEX_H > # include_next <complex.h> > # endif 66,74d37 < extern double complex clog(double complex); < extern double complex conj(double complex); < extern double complex cpow(double complex, double complex); < extern double complex cproj(double complex); < extern double complex csin(double complex); < extern double complex csinh(double complex); < extern double complex csqrt(double complex); < extern double complex ctan(double complex); < extern double complex ctanh(double complex); 76,97c39,40 < extern long double cabsl(long double complex); < extern long double cargl(long double complex); < extern long double cimagl(long double complex); < extern long double creall(long double complex); < extern long double complex cacoshl(long double complex); < extern long double complex cacosl(long double complex); < extern long double complex casinhl(long double complex); < extern long double complex casinl(long double complex); < extern long double complex catanhl(long double complex); < extern long double complex catanl(long double complex); < extern long double complex ccoshl(long double complex); < extern long double complex ccosl(long double complex); < extern long double complex cexpl(long double complex); < extern long double complex clogl(long double complex); < extern long double complex conjl(long double complex); < extern long double complex cpowl(long double complex, long double complex); < extern long double complex cprojl(long double complex); < extern long double complex csinhl(long double complex); < extern long double complex csinl(long double complex); < extern long double complex csqrtl(long double complex); < extern long double complex ctanhl(long double complex); < extern long double complex ctanl(long double complex); --- > #ifndef _GLIBCXX_COMPLEX_H > #define _GLIBCXX_COMPLEX_H 1 99,101c42 < #endif /* !defined(__cplusplus) */ < < #endif /* _COMPLEX_H */ --- > #endif %