linux-mips
[Top] [All Lists]

RE: [PATCH 5/5] MIPS: LLVMLinux: Silence unicode warnings when preproces

To: "Maciej W. Rozycki" <macro@linux-mips.org>, Daniel Sanders <Daniel.Sanders@imgtec.com>
Subject: RE: [PATCH 5/5] MIPS: LLVMLinux: Silence unicode warnings when preprocessing assembly.
From: Toma Tabacu <Toma.Tabacu@imgtec.com>
Date: Thu, 5 Feb 2015 10:25:14 +0000
Accept-language: en-GB, en-US
Cc: Ralf Baechle <ralf@linux-mips.org>, Paul Burton <Paul.Burton@imgtec.com>, Paul Bolle <pebolle@tiscali.nl>, "Steven J. Hill" <Steven.Hill@imgtec.com>, Manuel Lauss <manuel.lauss@gmail.com>, Jim Quinlan <jim2101024@gmail.com>, "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
In-reply-to: <alpine.LFD.2.11.1502041022150.22715@eddie.linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1422970639-7922-1-git-send-email-daniel.sanders@imgtec.com> <1422970639-7922-6-git-send-email-daniel.sanders@imgtec.com> <alpine.LFD.2.11.1502041022150.22715@eddie.linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
Thread-index: AQHQP7ajKQVJ2AEG9063KpjdfAGJ6ZzgTWsAgAGO+TA=
Thread-topic: [PATCH 5/5] MIPS: LLVMLinux: Silence unicode warnings when preprocessing assembly.
On Wed, 4 Feb 2015, Maciej W. Rozycki wrote:
> 2. It considers these character pairs to be unicode escapes in the first 
>    place given that they do not follow the syntax required for such 
>    escapes, that is `\unnnn', where `n' are hex digits.
> 

It doesn't actually treat them as unicode escapes, but it still warns the user,
in case they were meant to be unicode escapes. Here's the warning message:

arch/mips/include/asm/asmmacro.h:197:51: warning: \u used with no following hex 
digits; treating as '\' followed by identifier [-Wunicode]
         .word  0x41000000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel)
                                                          ^
I'll add it to the summary in v2.

> Of course it may be reasonable for us to work this bug around as we've 
> been doing for years with GCC, but has the issue been reported back to 
> clang maintainers?  What was their response?
> 

It hasn't been reported, but I don't think they would agree with removing
unicode escape sequences from the assembler-with-cpp mode because it is
currently being used for other languages as well, not just assembly.

One such language is Haskell (ghc, to be more specific), for which the clang
developers had to actually stop the preprocessor from enforcing the C universal
character name restrictions in assembler-with-cpp mode, which suggests that ghc
wants the preprocessor to check for unicode escape sequences.

At the moment, we can either disable -Wunicode for asmmacro.h or refrain from
using '\u' as an identifier.

<Prev in Thread] Current Thread [Next in Thread>