Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 23 Nov 2014 19:01:24 +0100
From: Jens Gustedt <jens.gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] Add stdatomic.h for clang>=3.1 and gcc>=4.1

Am Sonntag, den 23.11.2014, 11:37 -0500 schrieb Rich Felker:
> But it's a variably-modified type, so sizeof and typeof evaluate the
> expression when their operand is of this type.  Thus, all you have
> to do is make an array of objects of this type, and then refer to
> arr[i++]. This will be an expression with variably-modified type,

yes, but not a VLA

> and the evaluation will have unwanted side effects.

No, I don't think it is evaluated, 6.5.3.4 says:

  If the type of the operand is a variable length array type, the
  operand is evaluated;

observe that it says VLA, and not VM type.

  otherwise, the operand is not evaluated and the result is an integer
  constant.

There are no exception for other VM types. To deduce the size for our
case here, an evaluation isn't necessary.

(Hoping that the __typeof__ stuff follows the same rules.)

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 ::



Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.