Last active
May 17, 2017 07:15
-
-
Save lenary/ed2759af551d50a99ba7b0451cb55912 to your computer and use it in GitHub Desktop.
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> | |
// The file with the unchecked interface | |
#include <stdlib.h> | |
// The Redeclaration with the correct type | |
void *calloc(size_t nmemb, size_t size) : byte_count(nmemb * size); | |
#pragma BOUNDS_CHECKED ON | |
int main(void) { | |
_Array_ptr<int> arr : count(4) = calloc(4, sizeof(int)); | |
for (int i = 0; i < 4; i++) | |
_Unchecked { | |
printf("%d\n", arr[i]); | |
} | |
return 0; | |
} |
I updated it with the right keyword names and including the stdio header. Oops. But you got the idea.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Okay, I will refer this example code
Actually, I will insert additional test code for checkedc/typechecking/checked_scope.c using above example code
Thanks a lot