- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I'm compiling with icl some code that has previously been compiled with gcc. I'm getting errors because icl doesn't like declarations appearing after executable statements in a function. I can fix these errors by moving the declarations to the top of the functions, but I'm wondering is there is a compiler option that would take care of it. The source files have '.c' extension, and I'd rather not change that.
Thanks
Gib
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As long as you follow C language syntax, icc should compile without issue. The icc works for me.
$ cat hello.c
//hello.c
#include
int main()
{
printf("Hello World...!!!\n");
int x, y, z;
x = 5;
y = 10;
z = x+y;
float fx;
fx = 3.0* x;
printf("x = %d, y = %d, z = %d, fx = %f\n", x, y, z, fx);
return 0;
}
$ icc hello.c
$ ./a.out
Hello World...!!!
x = 5, y = 10, z = 15, fx = 15.000000
$ icc -V
Intel C Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100128 Package ID: l_cproc_p_11.1.066
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.
$ uname -a
Linux dpd22 2.6.18-52.el5 #1 SMP Wed Sep 26 15:26:44 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It will help if you couldpost test case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The workaround is to use:-- /Qstd=c99 option in Windows* . In Linux*, this option is not required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can use /Qstd=c99 when compiling with icl, but because of the makefile problems I've encountered (see my other thread) I am now trying to build this application using MS Visual Studio. I've tried adding the following to Configuration Properties > C/C++ > Command line > Additional options:
-Qstd:c99
/Qstd:c99
-Qstd=c99
/Qstd=c99
-std:c99
-std=c99
/Qc99
but none works.
Since the help docs say of Qstd that
IDE Equivalent
Windows: Language > Enable C++0x Support
I looked for such an option in the project properties, but didn't find it.
Is there a way to get the effect of /Qstd=c99 in MSVS?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When using MSVS, it seems you forgot to change to Intel compiler. so its using cl compiler, for which /Qstd=c99 does not work. To change the compiler, right-click Project in the Solution Explorer Window, and > Parallel Composer> Use Intel C++. Then the option will work.
If you want to work with MS compiler, then go to Properties>C/C++>Advanced>Compile As , and set as C++ code (/TP) option, and it will work, for icl as welll as cl. Hope it works in your case too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was just about to say "Do you think I'm stupid?" then I checked and found that I am! I didn't even realize that I had MSVC installed - this is my first foray into C for a few years.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page