mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jens Gustedt <jens.gustedt@inria.fr>
To: musl@lists.openwall.com
Subject: Re: [PATCH] Convert some is* macros to inline functions
Date: Mon, 13 Oct 2014 16:35:14 +0200	[thread overview]
Message-ID: <1413210914.4885.1174.camel@eris.loria.fr> (raw)
In-Reply-To: <20141013142020.GA26828@zx-spectrum.accesssoftek.com>

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

Am Montag, den 13.10.2014, 17:20 +0300 schrieb Sergey Dmitrouk:
> Hello,
> 
> eight is* functions of C standard library are also declared in form of
> macros in headers provided by musl.  Standard doesn't seem to allow them
> to be implemented as macros.

why would that be?

In section 7.1.4 the C standard explicitly says:

  > Any function declared in a header may be additionally implemented
  > as a function-like macro defined in the header, ...


> Please find the attached patch that proposes replacing these macros
> with inline functions.

I don't think that this is necessary.

They only advantage of inline functions, here would be that the
conversion of the arguments would be done with implicit conversions
instead of casts. (For the macros this could be achieved by using
compound literals instead of casts, but well...)

Jens


-- 
:: INRIA Nancy Grand Est ::: AlGorille ::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2014-10-13 14:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-13 14:20 Sergey Dmitrouk
2014-10-13 14:35 ` Jens Gustedt [this message]
2014-10-13 18:00   ` Sergey Dmitrouk
2014-10-13 18:06     ` Rich Felker
2014-10-13 18:49       ` Szabolcs Nagy
2014-10-14  9:01         ` Sergey Dmitrouk
2014-10-14 16:34           ` Rich Felker

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=1413210914.4885.1174.camel@eris.loria.fr \
    --to=jens.gustedt@inria.fr \
    --cc=musl@lists.openwall.com \
    /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/musl/

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).