9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Julius Schmidt <aiju@phicode.de>
To: 9front@9front.org
Subject: mp(2) base parameters
Date: Thu, 31 Dec 2015 12:08:14 +0100 (CET)	[thread overview]
Message-ID: <alpine.LNX.2.00.1512311202590.3581@localhost> (raw)

A lot of mp(2) string-related functions currently default to base 16 if no 
base is supplied.

I would like to see the following changes to this behaviour:

- strtomp should treat 0 the same as strtol (i.e. interpret 0x prefix 
etc.)
- other functions may treat 0 as 16 for compatibility
- any value of base that is neither 0 nor a currently implemented base 
should call abort()

This allows further expansion of support for various bases without 
breaking existing behaviour in subtle ways (I've already added support 
for bases 2, 4, 8 in various places).

Of course, this change WILL break existing code but hopefully in a more 
obvious way. The strtomp 0 change is probably the most dangerous but I 
also think it makes a lot of sense.

Ideally someone would write code that can handle any base (within limits).

aiju


             reply	other threads:[~2015-12-31 11:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-31 11:08 Julius Schmidt [this message]
2015-12-31 15:24 ` [9front] " cinap_lenrek

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=alpine.LNX.2.00.1512311202590.3581@localhost \
    --to=aiju@phicode.de \
    --cc=9front@9front.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 NNTP newsgroup(s).