Exemplo n.º 1
0
/* 這是一個函數的定義,函數參數可以認為是局部變量 */
int fn_c( int x_local)
{
    
/* 這是一個未初始化的局部變量的定義 */
    int y_local_uninit ;
    
/* 這是一個初始化的局部變量的定義 */
    int y_local_init = 3 ;
 
    
/* 以下代碼通過局部變量、全局變量和函數的名字來使用它們 */
    x_global_uninit = fn_a (x_local, x_global_init);
    y_local_uninit = fn_a (x_local, y_local_init);
    y_local_uninit += fn_b (z_global);
    return (x_global_uninit + y_local_uninit);
} 
Exemplo n.º 2
0
int
main (void)
{
  volatile int a[5];
  a[4] = 1;
  a[2] = a[3];
  fn_p (a[4]);
  fn_a (a);

  int i = 4;
  a[i] = 1;
  a[2] = a[i];
  fn_p (a[i]);
  foo_i (i);

  const int n = 5;
  volatile int b[n];
  b[4] = 1;
  b[2] = b[3];
  fn_p (b[4]);
  fn_a (b);

  volatile int c[n][n][n];
  c[2][2][2] = 2;
  i = c[4][4][4];

  volatile struct S s;
  s.a[9] = 1;
  i = s.a[9];

  /* Don't instrument flexible array members.  */
  struct T *t = (struct T *) __builtin_malloc (sizeof (struct T) + 10);
  t->a[1] = 1;

  struct U *u = (struct U *) __builtin_malloc (sizeof (struct U) + 10);
  u->a[1] = 1;

  long int *d[10][5];
  d[9][0] = (long int *) 0;
  d[8][3] = d[9][0];

  return 0;
}
Exemplo n.º 3
0
int main(int argc,char* argv[]){
    const char* message = "Hello,world";
    return fn_a(11,12);
}