zsh-workers
 help / color / mirror / code / Atom feed
From: Joey Pabalinas <joeypabalinas@gmail.com>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: Taylor West <krokodileglue@outlook.com>,
	"zsh-workers@zsh.org" <zsh-workers@zsh.org>,
	Joey Pabalinas <joeypabalinas@gmail.com>
Subject: Re: [PATCH] remove unnecessary checks for NULL in zfree and zsfree
Date: Thu, 1 Mar 2018 11:37:29 -1000	[thread overview]
Message-ID: <20180301213729.voxfugclges27liu@gmail.com> (raw)
In-Reply-To: <20180301194554.12932e8b@ntlworld.com>

[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]

On Thu, Mar 01, 2018 at 07:45:54PM +0000, Peter Stephenson wrote:
> OK, I would be a bit surprised if there were any pre-ANSI compilers
> still in use.  Unless someone tells me they have a SunOS 4.1.1 system
> proudly sitting on their desk.

Yeah, I mean even in the C89 draft the free() function is required to
be a no-op if the pointer is NULL:

> 4.10.3.2 The free function
> 
> The free function causes the space pointed to by ptr to be deallocated,
> that is, made available for further allocation. If ptr is a null pointer,
> no action occurs. Otherwise, if the argument does not match a pointer
> earlier returned by the calloc , malloc , or realloc function, or if
> the space has been deallocated by a call to free or realloc , the
> behavior is undefined.

So I don't see any problems with this patch, personally.

The only times I have ever seen people use pre-ANSI compilers
they were only uses them on pre-ANSI programs; I don't think
anyone expects to be able to compile moderns programs with a
compiler that old.

-- 
Joey Pabalinas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2018-03-01 21:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01  1:15 Taylor West
2018-03-01  1:17 ` Taylor West
2018-03-01  9:15   ` Peter Stephenson
2018-03-01 13:29     ` Taylor West
2018-03-01 19:45       ` Peter Stephenson
2018-03-01 21:37         ` Joey Pabalinas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180301213729.voxfugclges27liu@gmail.com \
    --to=joeypabalinas@gmail.com \
    --cc=krokodileglue@outlook.com \
    --cc=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).