Porting from GNU gcc* to Microsoft Visual C++*

You can use the -diag-enable port-win option to alert you to general syntactical problems when porting an application from GNU gcc* to Microsoft Visual C++*. The following examples illustrate use of this option.

Example 1:

$ cat -n attribute.c

     1 int main()

     2 {

     3   int i __attribute__((unused));

     4   return 0;

     5 }

$ icc -c -diag-enable port-win attribute.c

attribute.c(3): warning #2133: attributes are a GNU extension

    int i __attribute__((unused));

Example 2:

$ cat -n state_expr.c

     1 int main()

     2 {

     3   int i = ({ int j; j = 1; j--; j;});

     4   return i;

     5 }

$ icc -c -diag-enable port-win state_expr.c

state_expr.c(3): warning #2132: statement expressions are a GNU extension

    int i = ({ int j; j = 1; j--; j;});