unsigned_char

Login to reply to this topic.
Tue, 2008-03-18 15:50
Joined: 2008-01-17
Forum posts: 9

I need to represent "char" as "signed char". But GCCE by default set it as "unsigned char".
I tried to use <#pragma unsigned_char off> but without results.
How I can redefine char ?
And how I can to look the current compiler options int Carbide ?
Many thanks for assistance/


Thu, 2008-03-20 12:18
Forum Nokia Champion
Joined: 2006-10-12
Forum posts: 463
Re: unsigned_char

And how I can to look the current compiler options int Carbide ?

Right Click on your project->properties.

Sat, 2008-03-22 14:16
Joined: 2005-06-09
Forum posts: 174
Re: unsigned_char

A quick web search gave me this: http://www.network-theory.co.uk/docs/gccintro/gccintro_71.html , which claims that you can use -fsigned-char and -funsigned-char.

As an addendum, the best solution would be to always declare your chars as either signed or unsigned. It's quite uncommon that the sign of chars actually matters, and when it does, it's much better to be explicit about it, for reasons of maintainability and readability.


Tue, 2008-03-25 11:36
Joined: 2008-01-17
Forum posts: 9
Re: unsigned_char

Thanks for answer !
"-fsigned-char" options does not work on GCCE compiler. I try possible all combinations of "f", "un", "signed","char" but without results. So I used explicit form : signed char.

  • Login to reply to this topic.