bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: /*unsigned*/ int level3 in gen-uni-tables.c


From: Florian Weimer
Subject: Re: /*unsigned*/ int level3 in gen-uni-tables.c
Date: Wed, 12 Aug 2020 21:36:16 +0200

* Bruno Haible:

>> This kind of narrowing initialization is no longer valid C++.
>
> Indeed, GCC 10.2.0 and clang give errors about this code when uses as C++ 
> code:
>
> $ gcc -Wall -O -S -x c++ foo.c
> foo.c:156:1: error: narrowing conversion of '4294967295' from 'unsigned int' 
> to 'int' [-Wnarrowing]
>   156 | };
>       | ^
> foo.c:156:1: error: narrowing conversion of '2147483648' from 'unsigned int' 
> to 'int' [-Wnarrowing]
> foo.c:156:1: error: narrowing conversion of '4294967295' from 'unsigned int' 
> to 'int' [-Wnarrowing]
>
> But why would this matter? This is C code, not C++ code.

Since gnulib is a copylib, it doesn't have much control over how it is
built.  It's one of the issues that came up while trying to build
things with a C++ compiler instead of a C compiler.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]