Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and GDB*
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.

Option '-TC'

GisleVanem
Beginner
527 Views

Just installed Intel's oneAPI and it's compiler dpcpp.exe.

Trying it to compile a C-project of mine seems impossible w/o a major rewrite.

Seems to me it only supports C++ even when using "dpcpp -TC ...". Rather disappointing.

 

Many warnings on stuff like "char *p = malloc (len);" causing

error: cannot initialize a variable of type 'char *' with an rvalue of type 'void *'

 

So what's the option "-TC" really for?

 

Edit: Switching to icx.exe did the trick. 

0 Kudos
7 Replies
DitiD_Intel
Moderator
503 Views

Hi,


Thank you for posting in Intel Communities.


>> So what's the option "-TC" really for?


This option tells the compiler to process all source or unrecognized file types as C source files.


For more information, please refer to the link mentioned below.


https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-an...


Could you please provide us with a sample reproducer along with the compiler version being used so that we can investigate your issue from our end.


Thanks and Regards,

Ditipriya.


GisleVanem
Beginner
495 Views

Could you please provide us with a sample reproducer along with the compiler version being used so that we can investigate your issue from our end.


Here is a simple example GNU-makefile (called dpcpp-test.mak) or attached:

------------- 8< --- 8< -----------

CFLAGS = -MD -TC

all: dpcpp-test.exe

dpcpp-test.exe: dpcpp-test.obj
  xilink -out:dpcpp-test.exe $<

dpcpp-test.obj: dpcpp-test.c
  dpcpp $(CFLAGS) -Fo$@ $<

dpcpp-test.c: dpcpp-test.mak
  $(info Generating $@)
  $(file > $@,$(dpcpp-test_C))

 

define dpcpp-test_C
  //
  // Generated file. DO NOT EDIT!
  //
  #include <stdio.h>
  #include <stdlib.h>
  int main (void)
  {
    char *p = malloc(1000);

    printf ("p: 0x%p\n", p);
    p ? free(p) : ((void)0);
    return (0);
  }
endef

------------- 8< --- 8< -----------

Issuing make -f dpcpp-test.mak, gives:

 

Generating dpcpp-test.c
dpcpp -MD -TC -Fodpcpp-test.obj dpcpp-test.c
dpcpp-test.c(8,11): error: cannot initialize a variable of type 'char *' with an rvalue of type 'void *'
char *p = malloc(1000);
^ ~~~~~~~~~~~~
1 error generated.

 

Enough said.

 

 

DitiD_Intel
Moderator
424 Views

Hi,


DPC++ will support only c++ code from c++ 17 and onwards. Hence -TC option does not work.

It is working with icx and icx in windows works for both c as well as c++ code. So, it is behaving correctly.


Thanks and Regards,

Ditipriya.


GisleVanem
Beginner
416 Views

>  Hence -TC option does not work.

 

A dpcpp -? lists it as an valid option.  Time to clean-up this options mess?

DitiD_Intel
Moderator
400 Views

Hi,

 

Could you please confirm the OS you're using?

 

For windows, /TC is a valid option, however for linux, -TC is not listed as a valid option.

 

Thanks and Regards,

Ditipriya.

 

 

DitiD_Intel
Moderator
353 Views

Hi,


We've not heard back from you. Can you please provide an update?


Thanks and Regards,

Ditipriya.



DitiD_Intel
Moderator
344 Views

Hi,


We have not heard back from you. This thread will no longer be monitored by Intel. If you need further assistance, please post a new question.


Thanks & Regards,

Ditipriya.


Reply