-x cpp-output not working

-x cpp-output not working

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.


4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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


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.

Leave a Comment

Please sign in to add a comment. Not a member? Join today