[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avrdude-dev] Fix warnings patch
From: |
E. Weddington |
Subject: |
Re: [avrdude-dev] Fix warnings patch |
Date: |
Thu, 28 Aug 2003 15:50:38 -0600 |
On 28 Aug 2003 at 14:48, Theodore A. Roth wrote:
> > This is why it's important to fix these warnings as soon as possible; it's
> > difficult to remember / figure out later.
>
> True. Which is why simulavr is setup to compile with -Wall -Werror. I
> was reluctant to do that to avrdude and forget to set my CFLAGS when
> configuring avrdude. [note: simulavr has some nasty casting problems
> which show up when using the latest gcc (3.3.x)]
Why not set up avrdude to have -Wall -Werror?
> >
> > Given the code structure as it stands, typecasting is at the very least
> > safe, even though I have no idea what the original intent was.
>
> If you consider the problem from the perspective of type promotion,
> then, changing the %d to %ld is the safest thing to do.
>
> size = rc; /* promotes rc to long */
Implicitly, I might add. I wish I knew if were intentional (explicit) such
as:
size = (long)rc;
>
> With your cast, a change to rc in the future could break the code,
> whereas changing the spec is immune.
>
Point. I'll go ahead and change the spec then. But at some point it would
be nice if Brian would go through this and fix the typing to what was
intended.
Eric