From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <20151126113730.GA893@polynum.com> References: <20151125160347.GN20646@sigint.cs.purdue.edu> <79F2255E-5E76-43E8-83B3-0DFB2CD34AC7@bitblocks.com> <3175949A-26D0-4C4A-BB7D-4E5A3EA7F8B7@me.com> <20151126113730.GA893@polynum.com> Date: Thu, 26 Nov 2015 11:55:23 +0000 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a11467fc6f721b50525703f5d Subject: Re: [9fans] Undefined Behaviour in C Topicbox-Message-UUID: 77b2bffc-ead9-11e9-9d60-3106f5b1d025 --001a11467fc6f721b50525703f5d Content-Type: text/plain; charset=UTF-8 On 26 November 2015 at 11:37, wrote: > Plus, in C, 0 is used as a truth value for false... > That doesn't say how a 0 value for a pointer is represented; it's just how it's written in the program text. The compiler knows the types and can convert (same as double = 0). In practice, you can't change it because too much code assumes that mallocz and memset(..., 0, ...) of structures containing pointer values will initialise them to null. --001a11467fc6f721b50525703f5d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On 26 November 2015 at 11:37, <tlaronde@polynum.com> wro= te:
Plus, in C, 0 is used as a truth value for false...

That doesn't say how a 0 value for a poin= ter is represented; it's just how it's written in the program text.=
The compiler knows the types and can conve= rt (same as double =3D 0).

In practice, you can't change it because too much = code assumes that mallocz and memset(..., 0, ...) of structures
containing pointer values will initialise them to null= .
--001a11467fc6f721b50525703f5d--