[asterisk-dev] [Code Review] 4091: build: Force -fsigned-char on platforms where the default for char is unsigned.

Corey Farrell reviewboard at asterisk.org
Fri Oct 17 08:51:40 CDT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4091/#review13569
-----------------------------------------------------------



branches/12/configure.ac
<https://reviewboard.asterisk.org/r/4091/#comment24091>

    Is it appropriate for us to use $ac_cv_c_char_unsigned?  I raise this question since the variable is not documented.
    
    Might be better to just directly test "((char) -1) < 0" the same way AC_C_CHAR_UNSIGNED does, except to just set CONFIG_SIGNED_CHAR.


- Corey Farrell


On Oct. 16, 2014, 6:18 p.m., George Joseph wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4091/
> -----------------------------------------------------------
> 
> (Updated Oct. 16, 2014, 6:18 p.m.)
> 
> 
> Review request for Asterisk Developers and Corey Farrell.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> gcc on the ARM platform defaults 'char' to 'unsigned char' whereas Intel and SPARC default to 'signed char'.  This is only an issue in the rare cases where negative values are assigned to a 'char' but this this patch insures compatibility by detecting platforms that default to 'unsigned' and adding an '-fsigned-char' flag to _ASTCFLAGS.
> 
> The change to autoconfig.h.in is a harmless addition produced by configure.in.
> 
> If compiling for ARM (native or cross-compile) be sure to run ./bootstrap.sh and ./configure to regenerate the build files.  You shouldn't have to do this for Intel or SPARC.
> 
> 
> Diffs
> -----
> 
>   branches/12/makeopts.in 425744 
>   branches/12/include/asterisk/autoconfig.h.in 425744 
>   branches/12/configure.ac 425744 
>   branches/12/configure UNKNOWN 
>   branches/12/Makefile 425744 
> 
> Diff: https://reviewboard.asterisk.org/r/4091/diff/
> 
> 
> Testing
> -------
> 
> Tested native ARM, native Intel, cross-compile Intel->ARM, and native SPARC.  The -fsigned-char flag was only generated on native ARM and cross-compile ARM.
> There were no build errors.
> 
> 
> Thanks,
> 
> George Joseph
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20141017/9d459c62/attachment.html>


More information about the asterisk-dev mailing list