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

Re: gnome-pim: Cannot open user-cal.vcf or GnomeCard.gcrd on PPC

Brendan Simon. wrote
> I am a big PowerPC fan but I would like to know the reasoning behind the
> Linux/PPC people choosing unsigned char as the default char type.  Why go
> against the convention ?  I hope there is a really good reason that will help
> progress the C programming environment to better things.

I'm told for ARM it is a performance issue.  I've handled dozens of
these on the ARM port.  In almost all of them it is a getc/getchar
that is being coerced down to a char before being checked agains EOF.

getc and getchar are (int) functions, EOF is an int.  You can't cast
down to a char until you know you have a character and not an EOF.

Code with downcasts before checking EOF will fail one way on PPC and ARM
and the opposite way anytime it encounters a (char)255 in its input

Fortunately some wise soul extended the ARM compiler to print a warning
when a `char' is compared to a negative constant.  We collect these during
the builds and list them over at...
... there are only about 150 packages left with this problem.  
There are still packages like gnome-pim that can't be detected by the
compiler, but anytime a program hangs or fails to read a file this is
the first thing to look for on the ARM port.

I'll write a little script to blow all the compiler detected problems
into the BTS.  We'll see how many we can get cleaned up.

                                     Jim Studt, President
                                     The Federated Software Group, Inc.

Reply to: