Keean Schupke wrote:

I of course meant strongly-typed, you cannot pass a pointer to an int where a pointer
to a float is required ... modern C compilers require you to explicitly cast.

According to the C standard,

  void f(float *p) { *p + 1.0; }
  void g(void *p) { f(p); }
  void h(int n) { g(&n); }

is perfectly valid (though undefined).

Where
it fell down was all that automatic type promotion, and providing unsafe casts.

And other things, like unions, varargs, etc. Not to speak of subtyping in C++...


There is now a typesafe 'C', but I can't remember what it is called - presumably it uses some kind of linear-alias typing to make pointers safe.

Do you mean Cyclone?

  http://www.research.att.com/projects/cyclone/

Cheers,

        - Andreas

--
Andreas Rossberg, [EMAIL PROTECTED]

Let's get rid of those possible thingies!  -- TB

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to