[En-Nut-Discussion] Recent CVS changes
Harald Kipp
harald.kipp at egnite.de
Wed Nov 26 13:57:21 CET 2003
Hi Oliver,
Many thanks...you did a lot of work, indeed.
Doing a lot of work bears the risk of doing a lot
of errors and I found a few problems while trying
ICCAVR. Some of them may have been in the original
contribution already.
1. time_t is long, not unsigned long. ICCAVR detected
the problem at line 125 in crt/localtim.c
ptm->tm_yday += ltime;
! } else if (ltime < 0L) {
/*
ltime had been declared unsigned, in which case the
comparision above is always false. AVRGCC didn't spit
out any warnings...mhh...
I fixed this, time_t is now signed.
2. C doesn't allow doubleslash comments. Modern
compilers accept this, but that doesn't make it
C standard and may introduce problems one day.
3. C doesn't allow variable declarations following
statements. This is C++, not C. AVRGCC allows this,
but that is a rare exception.
a = 1;
int b = 5;
foobar(b);
is not valid in C. But the following is valid:
a = 1;
{
int b = 5;
foobar(b);
}
This had been spreaded all over the code. Hopefully
I didn't introduce new problems by correcting this.
4. const has a different meaning for ICCAVR. If specifies
program memory variables. IMHO, it was a very bad decision
by ImageCraft, to modify the meaning of this basic keyword.
Because of the large amount of exisiting ICCAVR code, we
have to stick with it. On the other hand, specifying const
variables is very valuable for most optimizers, therefore
compiler.h defines CONST (capital letters) as a replacement.
5. static THREAD() looks nice, but doesn't compile. Can't
remember the reason right now. I removed "static" from
sntp.c
I fixed these issues and committed the changes. None of
them had been tested by me. I just tried to get them compiled
and hope, I didn't destroy something.
Some "Open Source Community Procedure Purists" demanded
maintenance of a ChangeLog file. I still do not see any real
need when CVS is used, but well...let them do a favor.
Oliver, can you please update this file as well? Make sure
to use tabs, not spaces, for indention.
You did a good job.
Harald
More information about the En-Nut-Discussion
mailing list