bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Bruno Haible <bruno@clisp.org>
Cc: bug-gnulib@gnu.org
Subject: Re: [PATCH 1/4] localename: -Wtautological-pointer-compare
Date: Sun, 15 Jan 2023 16:15:04 -0800	[thread overview]
Message-ID: <3809858c-bc89-5bce-2c9c-747272c03f2c@cs.ucla.edu> (raw)
In-Reply-To: <2228043.iJkMF17ckq@nimes>

On 2023-01-15 14:03, Bruno Haible wrote:

>> My confusion arose partly because I am accustomed to languages where the
>> distinction between null and non-null pointers is checked statically ...
> 
> Oh, now I understand. May I guess the language: Haskell, OCaml, TypeScript,
> Rust?

These days OCaml and maybe Rust, though the language that first comes to 
my mind is one I designed in the 1970s and never got off the ground: B 
Pascal.


> Unfortunately, this is an excellent example for a portability problem:
> The division yields a SIGFPE on x86, x86_64, alpha, m68k, and s390/s390x
> CPU, but not on other architectures.

I suppose I should have written that my assumption was that the code is 
executed in a context where the divisor must be positive. (This is 
pretty common when calculating indexes from sizes.)

In other contexts the extra checking may be necessary, or at least helpful.


      reply	other threads:[~2023-01-16  0:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 20:17 [PATCH 1/4] localename: -Wtautological-pointer-compare Paul Eggert
2023-01-13 20:17 ` [PATCH 2/4] Don’t use alloc_size with xlclang 16.1 Paul Eggert
2023-01-13 20:17 ` [PATCH 3/4] assert-h: fix configure comment-out Paul Eggert
2023-01-13 20:17 ` [PATCH 4/4] assert-h: suppress xlclang 16.1 false alarms Paul Eggert
2023-01-13 22:59 ` [PATCH 1/4] localename: -Wtautological-pointer-compare Bruno Haible
2023-01-13 23:36   ` Paul Eggert
2023-01-14 11:00     ` Bruno Haible
2023-01-15  3:02       ` Paul Eggert
2023-01-15 22:03         ` Bruno Haible
2023-01-16  0:15           ` Paul Eggert [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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=3809858c-bc89-5bce-2c9c-747272c03f2c@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).