Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
7724 Discussions

icpc with old style Kernighan & Ritchie C

Arthur4
Beginner
577 Views

Hello,

I have an old C program I need to compile. It's been written in the old style C from the original Kernighan and Ritchie standard:

myfunc(a,b)

int a, b;

{

/* code */

}

I have been asked to use icpc. I have installed the latest version of icpc available for download today (10/26/2021). It's not surprising that I'm getting lots of errors.

Is there a compiler flag for icpc that will allow me to compile this old program?

Thanks.

0 Kudos
1 Solution
ShivaniK_Intel
Moderator
428 Views

Hi,


 >>>Is there a compiler flag for icpc that will allow me to compile this old program?

 

Sorry for the inconvenience. Unfortunately, there is no compiler flag for icpc that will allow you to compile the old C Program.

 

 Thanks & Regards

 Shivani


View solution in original post

6 Replies
ShivaniK_Intel
Moderator
543 Views

Hi,


Thanks for reaching out to us.


Thanks for reporting. We are able to reproduce the issue . We are working on it and will get back to you soon.


Thanks & Regards

Shivani




Viet_H_Intel
Moderator
519 Views

You can use icc instead of icpc on C file.

$ cat t2.c

#include<stdio.h>


int myfunc();


int myfunc(a,b)

int a,b;

{

  int c;

  c =a+b;

  return c;

}

$ icc t2.c -c

$



Arthur4
Beginner
490 Views

Thanks to Shivani and Viet. We have some company requirements on icpc, and I will wait for Shivani to determine whether there's a compiler flag that can be set to avoid having to use a different compiler or worse, rewriting that code!

Viet_H_Intel
Moderator
485 Views

AFAIK, there isn't an option so that icpc will accept the code. g++ won't compile it neither.

Thanks,



ShivaniK_Intel
Moderator
429 Views

Hi,


 >>>Is there a compiler flag for icpc that will allow me to compile this old program?

 

Sorry for the inconvenience. Unfortunately, there is no compiler flag for icpc that will allow you to compile the old C Program.

 

 Thanks & Regards

 Shivani


ShivaniK_Intel
Moderator
398 Views

Hi,


Thanks for accepting our solution. If you need any additional information please post a new question as this thread will no longer be monitored by intel.


Thanks & Regards

Shivani


Reply