CCured
1 program
Added 2026-03-10T13:35:35Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: CC
Provenance: commit 458713adb6 · authored 2026-03-10T14:36:07+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
2 sources · pl_id:
pl/ccRelated languages
LLM-contributed programs
String Reversal and Array Sum
Provenance: commit 458713adb6 · authored 2026-03-10T14:36:07+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
/* CCured: type-safe C with safe pointer arithmetic
* CCured retrofits legacy C code with type safety by inferring
* pointer kinds (SAFE, SEQ, WILD) and inserting runtime checks.
*/
#include <stdio.h>
#include <string.h>
/* Reverse a string in place using safe sequential pointers */
void reverse(char *s, int len) {
int i, j;
char tmp;
for (i = 0, j = len - 1; i < j; i++, j--) {
tmp = s[i];
s[i] = s[j];
s[j] = tmp;
}
}
/* Compute the length of a string */
int my_strlen(const char *s) {
int n = 0;
while (s[n] != '\0') n++;
return n;
}
int main(void) {
char buf[] = "Hello, CCured!";
int len = my_strlen(buf);
printf("Original: %s\n", buf);
reverse(buf, len);
printf("Reversed: %s\n", buf);
/* Demonstrate safe array access */
int arr[5] = {10, 20, 30, 40, 50};
int i, total = 0;
for (i = 0; i < 5; i++) {
total += arr[i];
}
printf("Array sum: %d\n", total);
return 0;
}
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)