История изменений
Исправление cvs-255, (текущая версия) :
#include <stdio.h>
int *f(void)
{
int a = 5;
return &a;
}
int main(void)
{
int *s = f();
printf("%d\n", *s);
*s = 2;
printf("%d\n", *s);
s = f();
printf("%d\n", *s);
}
хотя волатильность тут приплести тяжелее.
а вот static вполне влияние оказывает.
Исправление cvs-255, :
#include <stdio.h>
int *f(void)
{
int a = 5;
return &a;
}
int main(void)
{
int *s = f();
printf("%d\n", *s);
*s = 2;
printf("%d\n", *s);
s = f();
printf("%d\n", *s);
}
хотя волатильность тут приплести тяжелее.
Исправление cvs-255, :
#include <stdio.h>
int *f(void)
{
int a = 5;
return &a;
}
int main(void)
{
int *s = f();
printf("%d\n", *s);
}
хотя волатильность тут приплести тяжелее.
Исходная версия cvs-255, :
#include <stdio.h>
int *f(void)
{
int a = 5;
return &a;
}
int main(void)
{
int *s = f();
printf("%d\n", *s);
}