Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

-x cpp-output not working

Richard_G_4
Beginner
358 Views

When using ccache and compilng files with the -x c option, ccache first generates the preprocessed file then runs the intel compiler with -x cpp-output. According to the docs, it should treat the preprocessed file as a C file (not C++), but I'm getting void * casting errors. I don't see the same error with gcc, this looks like a bug?

I'm using Intel 13.1.1 20130313 on Fedora 14 64 bit.

Thanks

0 Kudos
3 Replies
SergeyKostrov
Valued Contributor II
358 Views
Please take a look at these Intel C++ compiler options: ... /Tc - compile file as C source /Tp - compile file as C++ source /TC - compile all source or unrecognized file types as C source files /TP - compile all source or unrecognized file types as C++ source files ...
0 Kudos
Richard_G_4
Beginner
358 Views

.

0 Kudos
Richard_G_4
Beginner
358 Views

Update : I was using icpc not icc. icpc is the equivalent of g++ (http://software.intel.com/en-us/forums/topic/308711). Looks like icpc doesn't obey -x cpp-output

@Sergey : Thanks, but those are windows compiler options and I'm using linux.

Reproducable case :

contents of main.i

# 1 "main.c"
int main()
{
  void * vp = 0;
  int * p = vp;
  return 0;
}

Command to run, I expected success :

icpc13 -c -x cpp-output -o main.o main.i

main.c(4): error: a value of type "void *" cannot be used to initialize an entity of type "int *"
int * p = vp;
^

compilation aborted for main.i (code 2)

The above command works with icc13 instead of icpc13.

0 Kudos
Reply