Grrr now _my_ program has a bug.

----------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>

void f (int a, int b);
int g (void);
int *global = NULL;

int
main (void)
{
  int x = 1;
  global = &x;
  f (g (), x);

  exit (0);
}

void
f (int a, int b)
{
  printf ("a = %d, b = %d\n", a, b);
}

int
g (void)
{
  if (global) {
    (*global)++;
    return *global;
  }
  else
    return 42;
}
----------------------------------------------------------------------

This program doesn't show undefined behaviour.

Rich.

-- 
Richard Jones
Red Hat

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to