Werner LEMBERG <[email protected]> writes:

> Folks,
>
>
> compiling git 17270930 with gcc 4.6.2 I get the following warnings:
>
>   beaming-pattern.cc:
>     In function
>       'void find_location(
>          SCM, Moment, Moment, Rational,
>          Moment*, Moment*, Moment*)':
>   beaming-pattern.cc:220:39:
>     warning: conversion to 'int' from 'I64 {aka long long int}'
>              may alter its value [-Wconversion]
>   beaming-pattern.cc:226:84:
>     warning: conversion to 'int' from 'I64 {aka long long int}'
>              may alter its value [-Wconversion]
>   beaming-pattern.cc:
>     In member function
>       'void Beaming_pattern::find_rhythmic_importance(
>          const Beaming_options&)':
>   beaming-pattern.cc:271:39:
>     warning: conversion to 'int' from 'I64 {aka long long int}'
>              may alter its value [-Wconversion]
>
> Maybe they can be fixed?

The real fix would be to retire Rational and replace it with SCM.  Then
we get a Scheme runtime error exactly when a conversion does not fit the
range, and don't need to juggle with extended precision all the time.

I actually have a branch "unrational" where I am through one third or
so.

There is a problem with Moment having constructors from both integers
and Rational, and SCM unfortunately is an integral type.  So one needs
to touch a few more things.  Also ly:make-moment with a variable number
of arguments should just take one or two rationals, not one to four
integers.

-- 
David Kastrup


_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
  • gcc warnings Werner LEMBERG
    • Re: gcc warnings David Kastrup

Reply via email to