Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.std.c Subject: Re: Adjacent string literals Date: Wed, 27 Jan 2021 15:46:49 +0000 Organization: A noiseless patient Spider Lines: 50 Message-ID: <87ft2mtmae.fsf@bsb.me.uk> References: <874kj3x4yr.fsf@bsb.me.uk> <875z3jv0bg.fsf@bsb.me.uk> <87lfcftc18.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="bcbf9425fa9b2a3a90492d55df1b13d5"; logging-data="10862"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Agw6kCkN8dC+OOutNiEviaGjoDz8aqGs=" Cancel-Lock: sha1:JyngEeURrUl2mYP+XKuKnhemeeM= sha1:ekf2tbl3uNIt2ll2FXWe3w141QY= X-BSB-Auth: 1.9d0c14642f2452180c6b.20210127154649GMT.87ft2mtmae.fsf@bsb.me.uk Xref: csiph.com comp.std.c:6208 James Kuyper writes: > On 1/26/21 8:16 PM, Ben Bacarisse wrote: >> James Kuyper writes: > ... >>> Yes, it is. In "a""b", the two tokens are adjacent. In "a" "b", they are >>> not, because both are adjacent to some white-space instead. >> >> Adjacent does not mean with nothing in between (thought it can, of >> course). What's more, things can be adjacent to each other, and also >> adjacent to something in between. I can say that there was a fire in >> the house adjacent to mine. The two house are adjacent. But both are >> adjacent to the lane separating them. > > It takes at least two dimensions for the issue you raise to come up. I don't follow. 1 and 2 are adjacent integers on the real line (i.e. despite having other kinds of number between them). In addition, they are both integers adjacent to 1/2. > As > far as the C standard is concerned, source code is a one-dimensional > sequence of characters. It's possible to think of the text > two-dimensionally, but the standard doesn't make use of that fact in any > way that I'm aware of. I don't think anyone would suggest that two > string literals that are vertically adjacent to each other: > > char first = "James"; > char second = "Kuyper"; > > should be merged. > Even if you acknowledge only that this is one possible way of > interpreting "adjacent", that would mean the meaning is ambiguous. Lots of words in the standard could, at a pinch, be taken to mean something other than what is obviously intended. But if you think someone might read about phase 6 and think that "a""b" will be concatenated but not "a" "b", then you should file a defect report. > Moving the first sentence of translation phase 7 to be the first > sentence of translation phase 6 would remove all ambiguity, and have, as > far as I can see, no other consequence. I think the strongest case for the possibility of misunderstanding comes from this sentence being where it is. I don't see any problem with the word "adjacent", but I can imagine someone wondering why this sentence is where it is if not to do what you are suggesting. -- Ben.