Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New GCC 5.0 hits problem with narrowing in list-initializers #26

Open
ghost opened this issue Jul 27, 2015 · 2 comments
Open

New GCC 5.0 hits problem with narrowing in list-initializers #26

ghost opened this issue Jul 27, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 27, 2015

Originally reported on Google Code with ID 26

Following errors are produced by GCC compiler:

c++ -MMD -MF obj/third_party/cld_2/src/internal/cld2_static.cld_generated_cjk_uni_prop_80.o.d
-DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DTOOLKIT_VIEWS=1
-DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_ASH=1 -DUSE_PANGO=1 -DUSE_CAIRO=1
-DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1
-DENABLE_ONE_CLICK_SIGNIN -DENABLE_PRE_SYNC_BACKUP -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1
-DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DUSE_UDEV
-DDONT_EMBED_BUILD_METADATA -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGINS=1
-DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1
-DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1
-DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1
-DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1
-DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DUSE_LIBPCI=1 -DUSE_GLIB=1
-DUSE_NSS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../third_party/cld_2/src/internal
-I../../third_party/cld_2/src/public -fstack-protector --param=ssp-buffer-size=4  -pthread
-fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden
-pipe -fPIC -B/home/marxin/Programming/chromium/src/third_party/binutils/Linux_x64/Release/bin
-Wno-unused-local-typedefs -Wno-format -Wno-unused-result -m64 -march=x86-64 -O2 -fno-ident
-fdata-sections -ffunction-sections -funwind-tables -fno-exceptions -fno-rtti -fno-threadsafe-statics
-fvisibility-inlines-hidden -Wno-deprecated -std=gnu++11 -Wno-narrowing -Wno-literal-suffix
 -c ../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc -o obj/third_party/cld_2/src/internal/cld2_static.cld_generated_cjk_uni_prop_80.o
-Wno-narrowing
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
 };
 ^
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
../../third_party/cld_2/src/internal/cld_generated_cjk_uni_prop_80.cc:7089:1: error:
narrowing conversion of ‘-14’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside
{ }
... (and many more)

Problem is more discussed in following thread: https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/D5YxoMmtEmE
I think fix is quite obvious, generator should produce just uint8 numbers.

Thanks,
Martin

Reported by marxin.liska on 2015-01-05 10:34:02

@ghost ghost self-assigned this Jul 27, 2015
@ghost
Copy link
Author

ghost commented Jul 27, 2015

Good morning, 
GCC 5.1 is now released and the check/error "narrowing conversion" is still here.
I would vote like Martin to fix the generator. 
Kindly
WT.

Reported by William.Tambellini on 2015-06-11 14:58:37

@ghost
Copy link
Author

ghost commented Jul 27, 2015

riesa@, any chance we could get the generator code checked in and start iterating on
it? Issue 33 is tracking that.

Reported by andrewhayden@google.com on 2015-06-11 15:53:55

jmhodges added a commit to jmhodges/cld2 that referenced this issue Oct 23, 2016
Use a bunch of static_cast<uint8> to get around the c++11-narrowing
errors when building as C++0x.

This hack is necessary because the source files and generation code has
not been released.

See CLD2Owners#33 on the source file
check-in.

See CLD2Owners#47
CLD2Owners#51
CLD2Owners#26 and I'm sure there are
others for the C++0x problem.
jmhodges added a commit to jmhodges/cld2 that referenced this issue Oct 23, 2016
hack up generated files to compile as c++0x

Use a bunch of static_cast<uint8> to get around the c++11-narrowing
errors when building as C++0x.
    
This hack is necessary because the source files and generation code has
not been released.
    
See CLD2Owners#33 on the source file
check-in.
    
See CLD2Owners#47
CLD2Owners#51
CLD2Owners#26 and I'm sure there are
others for the C++0x problem.
jjhoughton pushed a commit to jjhoughton/cld2 that referenced this issue Jul 9, 2022
Use a bunch of static_cast<uint8> to get around the c++11-narrowing
errors when building as C++0x.

This hack is necessary because the source files and generation code has
not been released.

See CLD2Owners#33 on the source file
check-in.

See CLD2Owners#47
CLD2Owners#51
CLD2Owners#26 and I'm sure there are
others for the C++0x problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants