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

icc 12.1 (update 6) -Wdeclaration-after-statement warns on every function

mansr
Beginner
359 Views
[plain]$ cat foo.c
void foo(void)
{
    int n;
}
$ icc -Wdeclaration-after-statement -c foo.c
foo.c(3): warning #311: declaration may not appear after executable statement in block
      int n;
      ^

$ icc --version
icc (ICC) 12.1.0 20110811
Copyright (C) 1985-2011 Intel Corporation.  All rights reserved.

[/plain]
This does not happen with any other release.
0 Kudos
1 Reply
Om_S_Intel
Employee
359 Views
I have reproduced the issue. I have submitted a report to Intel compiler development team. I will update the thread when I have more information on this.

0 Kudos
Reply