Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How to force char to be signed_char

Received: by 10.141.105.11 with SMTP id h11mr166663rvm.47.1276988672770;
        Sat, 19 Jun 2010 16:04:32 -0700 (PDT)
X-BeenThere: android-ndk@googlegroups.com
Received: by 10.141.213.18 with SMTP id p18ls2173196rvq.1.p; Sat, 19 Jun 2010 
	16:04:30 -0700 (PDT)
Received: by 10.141.22.14 with SMTP id z14mr165829rvi.28.1276988670142;
        Sat, 19 Jun 2010 16:04:30 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.101.152.10 with SMTP id e10mr865679ano.35.1276883244304; Fri, 
	18 Jun 2010 10:47:24 -0700 (PDT)
Received: by b35g2000yqi.googlegroups.com with HTTP; Fri, 18 Jun 2010 10:47:24 
	-0700 (PDT)
Date: Fri, 18 Jun 2010 10:47:24 -0700 (PDT)
X-IP: 24.126.174.216
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) 
	AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7,gzip(gfe)
Message-ID: <1cf5549f-31c7-4c6f-982e-883a631cf07c@b35g2000yqi.googlegroups.com>
Subject: How to force char to be signed_char
From: Dave <dhaup...@ddhsoftware.com>
To: android-ndk <android-ndk@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi all,

I am compiling a large amount of C and C++ code using the NDK.  Found
and tracked down a problem that occurs only on this platform and not
when used on many other platforms- the standard:

char array[10];

or

char charval;

is being treated as an unsigned char.  On other platforms it's treated
as a signed char.  Apparently this is a known fact with ARM
compilation when using GCC.   Supposedly you can do this:

gcc -fsigned_char  file.c

to force chars to be signed_char.  But since we don't have the ability
to pass variables to gcc here, we are supposed to use:

LOCAL_CFLAGS := -fsigned_char

Unfortunately that gives me the compiler error:
cc1plus: error: unrecognized command line option "-fsigned_char"

Does anyone know how I can make this adjustment to the compiler?  I'd
really like to not have to search through 100s of thousands of lines
of code changing all char definitions to signed char!