lilypond-devel
[Top][All Lists]
Advanced

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

Re: gcc warnings


From: David Kastrup
Subject: Re: gcc warnings
Date: Tue, 03 Jul 2012 08:05:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

Werner LEMBERG <address@hidden> 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




reply via email to

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