blob: f7730762d7935956c26a0d397012d36f1f22745e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
/*
bug2956580.c
*/
#include <testfwk.h>
// no need to call this, it generates compiler error:
// error 33: Attempt to assign value to a constant variable (=)
char foo(const char* s)
{
char a[1];
const char* ss = s;
// The value of the constant variable 's' is not modified rather the pointer is incremented for which SDCC seems to throw error.
// In reality it was the iTemp for *++s that was considered const but needs to be assigned.
a[*++s] |= 1;
return 0;
}
void
testBug (void)
{
ASSERT (1);
}
|