[Mesa-dev] [PATCH] nouveau: Fix clang reserved-user-defined-literal error.

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Mar 9 13:25:20 UTC 2016



On 03/09/2016 01:46 PM, Pierre Moreau wrote:
> I did hit that issue as well, but I have C++11 forced on my SPIR-V branch.
>
> I guess adding the whitespace will still result in code that works with older
> C++ version, so the fix can still be accepted even if we do not plan to switch
> to C++11 by default.
>

Sure, the patch looks fine, but I wonder how he did hit that issue. :-)

Anyway, if this doesn't break compilation without c++11, this patch is:

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

> Pierre
>
>
> On 11:16 AM - Mar 09 2016, Samuel Pitoiset wrote:
>> Nouveau doesn't use c++11 except the codegen part.
>> How do you hit that issue? Pretty sure that you forced c++11, right?
>>
>> I can't reproduce that compilation error with clang 3.9 btw.
>>
>> On 03/09/2016 09:57 AM, Vinson Lee wrote:
>>>    CXX      codegen/nv50_ir.lo
>>> In file included from codegen/nv50_ir.cpp:28:
>>> ./nouveau_debug.h:19:30: error: invalid suffix on literal; C++11 requires a space between literal and identifier
>>>        [-Wreserved-user-defined-literal]
>>>     fprintf(stderr, "%s:%d - "fmt, __FUNCTION__, __LINE__, ##args)
>>>                               ^
>>>
>>> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
>>> ---
>>>   src/gallium/drivers/nouveau/nouveau_debug.h | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/src/gallium/drivers/nouveau/nouveau_debug.h b/src/gallium/drivers/nouveau/nouveau_debug.h
>>> index d17df81..546a4ad 100644
>>> --- a/src/gallium/drivers/nouveau/nouveau_debug.h
>>> +++ b/src/gallium/drivers/nouveau/nouveau_debug.h
>>> @@ -16,7 +16,7 @@
>>>   #define NOUVEAU_DEBUG 0
>>>
>>>   #define NOUVEAU_ERR(fmt, args...)                                 \
>>> -   fprintf(stderr, "%s:%d - "fmt, __FUNCTION__, __LINE__, ##args)
>>> +   fprintf(stderr, "%s:%d - " fmt, __FUNCTION__, __LINE__, ##args)
>>>
>>>   #define NOUVEAU_DBG(ch, args...)           \
>>>      if ((NOUVEAU_DEBUG) & (NOUVEAU_DEBUG_##ch))        \
>>>
>>
>> --
>> -Samuel
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

-- 
-Samuel


More information about the mesa-dev mailing list