Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 811708 - sci-chemistry/openbabel-2.4.1-r2: narrowing conversion of '-16' from 'int' to 'char'
Summary: sci-chemistry/openbabel-2.4.1-r2: narrowing conversion of '-16' from 'int' to...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: riscv Linux
: Normal normal (vote)
Assignee: Gentoo Chemistry-Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: riscv-keywording
  Show dependency tree
 
Reported: 2021-09-05 06:22 UTC by Alex Fan
Modified: 2022-02-21 04:12 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,5.77 KB, text/plain)
2021-09-05 06:23 UTC, Alex Fan
Details
build log (build.log,166.32 KB, text/plain)
2021-09-05 06:23 UTC, Alex Fan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Fan archtester 2021-09-05 06:22:11 UTC
compilation fails on riscv64 with

/var/tmp/portage/sci-chemistry/openbabel-2.4.1-r2/work/openbabel-2.4.1/src/formats/yasaraformat.cpp: In member function ‘virtual bool OpenBabel::YOBFormat::WriteMolecule(OpenBabel::OBBase*, OpenBabel::OBConversion*)’:
  4 /var/tmp/portage/sci-chemistry/openbabel-2.4.1-r2/work/openbabel-2.4.1/src/formats/yasaraformat.cpp:475:40: erro    r: narrowing conversion of ‘-16’ from ‘int’ to ‘char’ [-Wnarrowing]
  5   475 |   char double1[8]={0,0,0,0,0,0,-16,0x3f};
  6       |                                        ^
  7 distcc[1191858] ERROR: compile /var/tmp/portage/sci-chemistry/openbabel-2.4.1-r2/work/openbabel-2.4.1/src/formats/yasaraformat.cpp on localhost failed


Reproducible: Always
Comment 1 Alex Fan archtester 2021-09-05 06:23:04 UTC
Created attachment 737566 [details]
emerge --info
Comment 2 Alex Fan archtester 2021-09-05 06:23:32 UTC
Created attachment 737569 [details]
build log
Comment 3 Alex Fan archtester 2021-09-05 06:29:47 UTC
The type 'char' in riscv is unsigned, which causes the conversion problem. 

The fix is simple by changing 'char' to 'unsigned char', which has already been fixed in newer upstream version 3.*

Add arm into the CC list because arm also has unsigned char.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-02-21 04:10:46 UTC
Nice find & debugging!