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: Discussion of partly-invasive changes needed for x32 port
Date: Mon, 20 Jan 2014 10:25:22 +0100	[thread overview]
Message-ID: <1390209922.6398.365.camel@eris.loria.fr> (raw)
In-Reply-To: <52DCE1B8.3020100@gentoo.org>

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

Hi,

Am Montag, den 20.01.2014, 09:43 +0100 schrieb Luca Barbato:
> On 20/01/14 08:41, Rich Felker wrote:
> > Adding the workaround code at every syscall point is ugly, and
> > possibly error-prone. An alternate possible solution is hacking up the
> > syscall macros in syscall_arch.h to detect "const struct timespec *"
> > arguments and auto-wrap them with compound literals that would fix-up
> > the padding. However this probably requires either C11 or GNU C
> > extensions. On the positive side, it would only affect x32; no changes
> > at all would be made to the source files or other archs'
> > syscall_arch.h logic.
> 
> Can a compiler supporting x32 be safely expected to support C11 ? If yes
> sounds the best route.

I have difficulties in understanding why C11 pops up, here. Compound
literals are in C since C99. gcc and clang support them since
ages.

Generally they provide a nice "static cast" that doesn't convert
blindly as the "C cast" and usually provide with better diagnostics in
cases things go wrong. E.g the macro that Rich mentioned early to cast
to long could use "(long const){ (X) }" instead of "(long)(X)", such
that conversion from pointer expressions wouldn't pass unnoticed. In
my opion macros shouldn't hide casts. A cast is a marker for the
compiler "you must know what your doing" which might not be the case,
if it is hidden like that.

Padding tricks may perhaps be played a bit more nicely with C11, but
they can be done with a bit more pain in previous version of the
standard, I think.


Jens

-- 
:: INRIA Nancy Grand Est :: http://www.loria.fr/~gustedt/   ::
:: AlGorille ::::::::::::::: office Nancy : +33 383593090   ::
:: ICube :::::::::::::: office Strasbourg : +33 368854536   ::
:: ::::::::::::::::::::::::::: gsm France : +33 651400183   ::
:: :::::::::::::::::::: gsm international : +49 15737185122 ::




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

  reply	other threads:[~2014-01-20  9:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20  7:41 Rich Felker
2014-01-20  8:43 ` Luca Barbato
2014-01-20  9:25   ` Jens Gustedt [this message]
2014-01-20 10:12     ` John Spencer
2014-01-20 10:55       ` Jens Gustedt
2014-01-20 23:57         ` Rich Felker
2014-01-21  8:29           ` Jens Gustedt
2014-01-21 11:33             ` Szabolcs Nagy
2014-01-21 13:59               ` Jens Gustedt
2014-01-21  1:47 ` John Spencer
2014-01-21  2:18   ` Rich Felker
2014-02-02  6:50 ` 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=1390209922.6398.365.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).