Newsgroups: comp.std.c
From: "Clive D. W. Feather" <cl...@on-the-train.demon.co.uk>
Date: Wed, 16 Jul 2003 09:43:35 +0100
Local: Wed, Jul 16 2003 4:43 am
Subject: Re: Missing constraints?
In article <bf1d6c$11f...@cuce.ruk.cuni.cz>, Miloslav Trmac
<tr...@popelka.ms.mff.cuni.cz> writes >Hello, 6.7.8: >Another two questions. >First, which constraint does the following translation unit violate? [#2] No initializer shall attempt to provide a value for an object not contained within the entity being initialized. Since "i" is not an object, any initializer will be attempting to There was a loose proposal to allow this as an extension. Under it, >Second, by current rules, the following two external declarations do not As far as I can see, it's allowed. However, I'm not sure if it should >violate any constraint: > int n, i; > int *p = (int *)(int (*)[n])&i; >(that is, address constant can contain casts to VM types). I can live >with that, I just wonder whether this is intentionally allowed. >(Yes, the cast may invoke UB, but I believe that's not relevant here). be: consider: int *p = (int *)(int (*)[n][n])&i; where the size of the second dimension affects something like alignment. -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
