Created
January 30, 2013 17:09
-
-
Save rofirrim/4674748 to your computer and use it in GitHub Desktop.
Intel C/C++ 12.0.4 generates wrong code and the assertion fails. Intel C/C++ 11 generates correct code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <assert.h> | |
int c[4+3][3*2]; | |
void f(int * const n, int * const m, int (**v)[*m * 2]) | |
{ | |
assert(&(c[*n][*m]) == &((*v)[*n][*m])); | |
} | |
int main(int argc, char* argv[]) | |
{ | |
int n = 4; | |
int m = 3; | |
int (*d)[3*2] = c; | |
f(&n, &m, &d); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment