(char *)malloc(100) (Re: 64 bits--why stop there?)

Peter da Silva peter at ficc.ferranti.com
Sat Sep 1 02:45:31 AEST 1990


In article <1375 at svin02.info.win.tue.nl> rcpieter at svin02.info.win.tue.nl (Tiggr) writes:
> So it is not a problem of a bit-adressing machine but of a braindead compiler.

No, it's neither. It's a case of incompatibilities between ints and pointers.
There are *lots* of machines where leaving malloc undeclared will produce
garbage:

	Intel anything.
	Small 68000 systems.
	Any 68000 system with efficient code generation (returning pointers
		in A0 instead of D0 is a pretty obvious win).
	Word-addressed machines.

Always declare everything, or expect things to fail.
-- 
Peter da Silva.   `-_-'
+1 713 274 5180.   'U`
peter at ferranti.com



More information about the Comp.lang.c mailing list