/* File: alias.c
   Unintentional Aliasing */
#include <stdio.h>
#include "genlib.h"
#include "simpio.h"

int * bad_function(int a) {
  int b ;

  b = 12 ;
  return &b ;
}

void func2 (int * p) {
  int local ;

  printf("In func2: &local = %d, p = %d\n",
	  &local, p) ;
  local = 29 ;
  *p = 13 ;
  printf("In func2: local = %d, *p = %d\n",
	 local, *p) ;
}

main() {
  int *p ;

  p = bad_function(5) ;
  printf("In main: *p = %d\n\n", *p) ;
  func2(p) ;

}
---------------------------------------------
In main: *p = 12

In func2: &local = 2147469084, p = 2147469084
In func2: local = 13, *p = 13