Spudd86 / glyphy

Automatically exported from code.google.com/p/glyphy
Other
0 stars 0 forks source link

including glyphy-freetype.h as extern "C" in C++ causes casting errors #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. make a main.cpp with extern "C" { #include <glyphy-freetype.h> }
2. build main.cpp with clang

What is the expected output? What do you see instead?

clang reports a number of warnings, all implicit type narrowing errors:

In file included from ../src/main.cpp:14:
/usr/local/include/glyphy/glyphy-freetype.h:43:24: error: 
non-constant-expression cannot be narrowed from type 'FT_Pos' (aka 'long') to 
'double' in initializer list [-Wc++11-narrowing]
  glyphy_point_t p1 = {to->x, to->y};

I expect there to be no casting errors.

What version of the product are you using? On what operating system?

// $ uname -a 
Darwin 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; 
root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64

// file: config.h
#define PACKAGE_STRING "glyphy 0.2.0"

// $ clang++ -v
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

Please provide any additional information below.

Original issue reported on code.google.com by brian.he...@gmail.com on 21 Jan 2014 at 9:44

GoogleCodeExporter commented 9 years ago
Can you please submit a patch to add explicit casts for those?  Thanks.

Original comment by behdad.e...@gmail.com on 10 Apr 2014 at 10:53