|
Message-ID: <20141123193902.GN29621@brightrain.aerifal.cx> Date: Sun, 23 Nov 2014 14:39:02 -0500 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: [PATCH] Add stdatomic.h for clang>=3.1 and gcc>=4.1 On Sun, Nov 23, 2014 at 07:01:24PM +0100, Jens Gustedt wrote: > 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.) OK, thanks for clarifying this. In that case I think we're safe as long as __typeof__ follows the same rules. Rich
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.