Use Intel C/C++ compilers V12.0.1.107 or higher version to resolve error when preprocessing and then compiling C++ language code which included math.h or mathimf.h header

Version:

Intel® C/C++ compilers V11.0 and earlier, and Intel® C/C++ compilers V12.0 built before 2010/10/29.

Product:

Intel® C/C++ compiler

Operating System:

Linux and MAC OS* X

Problem Description:

 

C++ language code using math.h or mathimf.h header file cannot be compiled by Intel® C/C++ compilers V11.0 and earlier version if it was first preprocessed to separate file and then compiled. The reason is that in C++ language, exception specification of functions corresponding to ISO C classification macros differs in GNU and Intel® math headers.

 

Consider as an example the following test.cpp file:

#include <math.h>

int foo() {

    float x=1.0;

    return (int)expf(x);

}

It can be preprocessed to file test1.cpp by the following command:

icc test.cpp -EP -o test1.cpp

But the new file fails to compile:

icc -c test1.cpp

It produces the errors like:

test1.cpp(1659): error: omission of exception specification is incompatible with previous function "__fpclassifyf" (declared at line 1146)

  extern int __fpclassifyf  ( float              __x );

 


Resolution Status:

The problem has been fixed in Intel® C/C++ compilers built after 2010/10/28, i.e. V12.0.1.107 or higher version. See /en-us/articles/intel-composer-xe for download.

For more complete information about compiler optimizations, see our Optimization Notice.

2 comments

Top
sakthi V.'s picture

Dear all

i have a problem with ifort and icc and icpc. the compilers do not compiling anything. i tried to compile a sample fortran 90 and c program. but the following error is dispalyed on terminal

[muthu_mku@kalki ~]$ icc array.c -o array
icc: internal error: error generating temporary file name, check disk space and permissions  (shared/driver/hostutil.c, line 853)
[muthu_mku@kalki ~]$ icpc array.c -o array
icpc: internal error: error generating temporary file name, check disk space and permissions  (shared/driver/hostutil.c, line 853)
[muthu_mku@kalki ~]$ ifort for.f95 -o for     
ifort: internal error: error generating temporary file name, check disk space and permissions  (shared/driver/hostutil.c, line 853)
[muthu_mku@kalki ~]$

i compiled it on a cluster which has the following memory places

[muthu_mku@kalki ~]$ df -lh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              95G   71G   20G  79% /
/dev/sda6              92G   86G  925M  99% /export
/dev/sda5              48G   32G   14G  71% /opt
/dev/sda1              99M   63M   31M  68% /boot
tmpfs                  16G     0   16G   0% /dev/shm
tmpfs                 7.7G   37M  7.7G   1% /var/lib/ganglia/rrds
[muthu_mku@kalki ~]$

could anyone help me to resolve this problem. my compilers are in latest version

[muthu_mku@kalki ~]$ which icpc icc ifort
/opt/intel/Compiler/11.1/046/bin/intel64/icpc
/opt/intel/Compiler/11.1/046/bin/intel64/icc
/opt/intel/Compiler/11.1/046/bin/intel64/ifort
[muthu_mku@kalki ~]$

thank you very much

Ulf H.'s picture

I use Intel Composer XE 2013 for Mac OS X and still get exactly THIS bug!

// snip //
icc --version
icc (ICC) 13.0.0 20120731

icc -c test1.cpp
test1.cpp(909): error: exception specification is incompatible with that of previous function "__fpclassifyf" (declared at line 497)
extern int __fpclassifyf ( float __x ) throw();
^

test1.cpp(910): error: exception specification is incompatible with that of previous function "__fpclassify" (declared at line 499)
extern int __fpclassify ( long double __x ) throw();
^

test1.cpp(911): error: exception specification is incompatible with that of previous function "__fpclassifyd" (declared at line 498)
extern int __fpclassifyd ( double __x ) throw();
^

test1.cpp(955): error: exception specification is incompatible with that of previous function "finite" (declared at line 845)
extern int finite ( double __x ) throw();
^

compilation aborted for test1.cpp (code 2)

// snip //

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.