avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Got strange compilation problem


From: David Bourgeois
Subject: Re: [avr-gcc-list] Got strange compilation problem
Date: Thu, 16 Feb 2006 11:09:03 +0100
User-agent: Opera M2/8.51 (Win32, build 7712)

Indeed, that was the issue, thanks!

On Thu, 16 Feb 2006 10:41:33 +0100, Bjarne Laursen <address@hidden> wrote:

David Bourgeois wrote:

uint8_t fifoLength(fifo_t *p)
{
    uint8_t length;

    length = (p->inIdx) - (p->outIdx);
    length %= FIFO_SIZE;
      return length;
}

You are casting the result of the subtraction to uint8_t before doing the modulos. If you write it in one statement it will be the same as the operants or at least int.
This could be the difference.

-Bjarne Laursen, RoseTechnology A/S



--
David Bourgeois

C2ME - Centre de Conception en Microtechnologies Européen sa
Parc Initialis - Rue René Descartes, 2 - 7000 Mons (Belgium)
Phone : +32 65 37 42 25 - Fax +32 65 37 42 36




reply via email to

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