language: C (gcc-4.7.2)
date: 275 days 5 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>
 
const char* f()
{
    return "hello";
}
int main()
{
    const char* c = f();
 
    *(c + 1) = 'a';
 
    return 0;
}
 
prog.c: In function ‘main’:
prog.c:11: error: assignment of read-only location ‘*(c + 1u)’