lilypond-devel
[Top][All Lists]
Advanced

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

Re: lilly_libcxx.patch for building against libc++


From: Jack Howarth
Subject: Re: lilly_libcxx.patch for building against libc++
Date: Fri, 15 Nov 2013 11:45:12 -0500
User-agent: Mutt/1.5.18 (2008-05-17)

On Thu, Nov 14, 2013 at 09:55:33PM +0100, David Kastrup wrote:
> Jack Howarth <address@hidden> writes:
> 
> >    The attached patch, lilly_libcxx.patch, contains the changes which allow 
> > lilypond 2.17.95
> > to build against libc++ on Xcode 10.9 with the clang++ compiler. There is a 
> > glitch in the
> > configure/makefiles currently that requires that the user pass 
> > -DHAVE_STL_DATA_METHOD on
> > CXXFLAGS. The problem is odd as configure seems able to set...
> >
> > /* define if you have stl data () method */
> > #define HAVE_STL_DATA_METHOD 1
> >
> > in the top level config.hh but it doesn't seem to get passed down to 
> > flowers/include/std-vector.hh
> > when included in file-path.cc.
> 
> See <URL:http://code.google.com/p/lilypond/issues/detail?id=3656>
> 
> Can you explain what the problem with to_string is actually about?  Can
> we fix this in a way that does not require explicit scoping?

David,
    I believe the problem may be described in this thread...

http://stackoverflow.com/questions/17136497/is-overriding-stdto-string-for-user-defined-enums-proper-way-to-privide-to-str

An example of the failing code in lilypond-devel-2.17.95 is attached as 
arpeggio.ii.bz2 which was generated with...

g++ -c -Woverloaded-virtual -I/sw/include/python2.7 -I/sw/include/python2.7 
-fno-strict-aliasing -g -g -fwrapv -fwrapv -I/sw/include -DHAVE_CONFIG_H 
-DNDEBUG -I./include -I./out -I../flower/include -I../flower/./out 
-I../flower/include -MD -O2 -finline-functions -g -pipe -I/sw/include 
-I/sw/include -D_THREAD_SAFE -I/sw/include/freetype2 -I/sw/include 
-I/sw/include/pango-1.0 -I/sw/include/freetype2 -I/sw/include 
-I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -W -Wall -Wconversion -o 
out/arpeggio.o arpeggio.cc --save-temps

on Xcode 5.0 using clang++ as g++. The compilation fails as...

# g++ -c -Woverloaded-virtual -I/sw/include/python2.7 -I/sw/include/python2.7 
-fno-strict-aliasing -g -g -fwrapv -fwrapv -I/sw/include -DHAVE_CONFIG_H 
-DNDEBUG -I./include -I./out -I../flower/include -I../flower/./out 
-I../flower/include -MD -O2 -finline-functions -g -pipe -I/sw/include 
-I/sw/include -D_THREAD_SAFE -I/sw/include/freetype2 -I/sw/include 
-I/sw/include/pango-1.0 -I/sw/include/freetype2 -I/sw/include 
-I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -W -Wall -Wconversion  
arpeggio.ii
clang: warning: argument unused during compilation: '-I /sw/include/python2.7'
clang: warning: argument unused during compilation: '-I /sw/include/python2.7'
clang: warning: argument unused during compilation: '-I /sw/include'
clang: warning: argument unused during compilation: '-I ./include'
clang: warning: argument unused during compilation: '-I ./out'
clang: warning: argument unused during compilation: '-I ../flower/include'
clang: warning: argument unused during compilation: '-I ../flower/./out'
clang: warning: argument unused during compilation: '-I ../flower/include'
clang: warning: argument unused during compilation: '-MD'
clang: warning: argument unused during compilation: '-I /sw/include'
clang: warning: argument unused during compilation: '-I /sw/include'
clang: warning: argument unused during compilation: '-I /sw/include/freetype2'
clang: warning: argument unused during compilation: '-I /sw/include'
clang: warning: argument unused during compilation: '-I /sw/include/pango-1.0'
clang: warning: argument unused during compilation: '-I /sw/include/freetype2'
clang: warning: argument unused during compilation: '-I /sw/include'
clang: warning: argument unused during compilation: '-I /sw/include/glib-2.0'
clang: warning: argument unused during compilation: '-I 
/sw/lib/glib-2.0/include'
In file included from arpeggio.cc:20:
In file included from ./include/arpeggio.hh:24:
In file included from ./include/grob-interface.hh:23:
In file included from ./include/lily-guile.hh:27:
In file included from /sw/include/libguile.h:24:
/sw/include/gmp.h:1791:48: warning: operand of ? changes signedness: 'const 
int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion]
  return ((__gmp_z->_mp_size) >= 0 ? (__gmp_z->_mp_size) : 
-(__gmp_z->_mp_size));
  ~~~~~~                              ~~~~~~~~~^~~~~~~~
/sw/include/gmp.h:1791:60: warning: operand of ? changes signedness: 'int' to 
'size_t' (aka 'unsigned long') [-Wsign-conversion]
  return ((__gmp_z->_mp_size) >= 0 ? (__gmp_z->_mp_size) : 
-(__gmp_z->_mp_size));
  ~~~~~~                                                   ^~~~~~~~~~~~~~~~~~~~
/sw/include/gmp.h:2058:345: warning: equality comparison with extraneous 
parentheses [-Wparentheses-equality]
  ...= 1; goto __gmp_done; } __gmp_x = (__gmp_xp)[__gmp_i]; } while 
((((__gmp_wp)[__gmp_i++] = (__gmp_x + 1) & ((~ (static_cast<mp_limb_t> (0))) >> 
0)) == 0)); } } if ((__gmp_w...
                                                                      
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/sw/include/gmp.h:2058:345: note: remove extraneous parentheses around the 
comparison to silence this warning
  ...= 1; goto __gmp_done; } __gmp_x = (__gmp_xp)[__gmp_i]; } while 
((((__gmp_wp)[__gmp_i++] = (__gmp_x + 1) & ((~ (static_cast<mp_limb_t> (0))) >> 
0)) == 0)); } } if ((__gmp_w...
                                                                     ~          
                                                                        ^   ~
/sw/include/gmp.h:2058:345: note: use '=' to turn this equality comparison into 
an assignment
  ...1; goto __gmp_done; } __gmp_x = (__gmp_xp)[__gmp_i]; } while 
((((__gmp_wp)[__gmp_i++] = (__gmp_x + 1) & ((~ (static_cast<mp_limb_t> (0))) >> 
0)) == 0)); } } if ((__gmp_wp...
                                                                                
                                                                      ^~
                                                                                
                                                                      =
In file included from arpeggio.cc:26:
./include/lookup.hh:27:1: warning: 'Lookup' defined as a struct here but 
previously declared as a class [-Wmismatched-tags]
struct Lookup
^
./include/lily-proto.hh:100:1: note: did you mean struct here?
class Lookup;
^~~~~
struct
arpeggio.cc:166:61: error: call to 'to_string' is ambiguous
      arrow = fm->find_by_name ("scripts.arpeggio.arrow." + to_string (dir));
                                                            ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:3999:8:
 note: candidate function
string to_string(int __val);
       ^
../flower/include/std-string.hh:44:8: note: candidate function
string to_string (int i, char const *format = 0);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4000:8:
 note: candidate function
string to_string(unsigned __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4001:8:
 note: candidate function
string to_string(long __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4002:8:
 note: candidate function
string to_string(unsigned long __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4003:8:
 note: candidate function
string to_string(long long __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4004:8:
 note: candidate function
string to_string(unsigned long long __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4005:8:
 note: candidate function
string to_string(float __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4006:8:
 note: candidate function
string to_string(double __val);
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:4007:8:
 note: candidate function
string to_string(long double __val);
       ^
../flower/include/std-string.hh:43:8: note: candidate function
string to_string (char c, int n = 1);
       ^
../flower/include/std-string.hh:45:8: note: candidate function
string to_string (double f, char const *format = 0);
       ^
../flower/include/std-string.hh:46:8: note: candidate function
string to_string (long);
       ^
../flower/include/std-string.hh:47:8: note: candidate function
string to_string (long unsigned);
       ^
../flower/include/std-string.hh:48:8: note: candidate function
string to_string (I64, char const *format = 0);
       ^
../flower/include/std-string.hh:49:8: note: candidate function
string to_string (unsigned);
       ^
../flower/include/std-string.hh:50:8: note: candidate function
string to_string (bool b);
       ^
4 warnings and 1 error generated.

I believe the problem is that lilypond is omitting the necessary overload in 
the correct
namespace. Looking at the preprocessed source, the failing call is...

arpeggio.cc:166:61: error: call to 'to_string' is ambiguous
      arrow = fm->find_by_name ("scripts.arpeggio.arrow." + to_string (dir));
                                                            ^~~~~~~~~
but dir is of type enum...

enum Direction
{
  UP = 1,
  DOWN = -1,
  LEFT = -1,
  RIGHT = 1,
  MIN = -1,
  MAX = 1,
  CENTER = 0,
  SMALLER = -1,
  BIGGER = 1,
  START = -1,
  STOP = 1,
# 47 "../flower/include/direction.hh"
  DIRECTION_LIMIT = 2,
  DIRECTION_NEG_LIMIT = -2,
};

  Direction dir = CENTER;

                  Jack  

> 
> -- 
> David Kastrup

Attachment: arpeggio.ii.bz2
Description: BZip2 compressed data


reply via email to

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