develooper Front page | perl.perl5.porters | Postings from December 2005

Re: [PATCH] Configure: stdio char (un)signedness

Thread Previous | Thread Next
From:
H.Merijn Brand
Date:
December 30, 2005 12:33
Subject:
Re: [PATCH] Configure: stdio char (un)signedness
Message ID:
20051230213309.4749893f@pc09
On Sat, 26 Nov 2005 11:25:18 +0200, Jarkko Hietaniemi <jhietaniemi@gmail.com>
wrote:

> Not that the detection of the stdio char signedness is all that
> important these days, but I grew bored by these warnings in Tru64:

I plan to look into this now very soon.
rgs, do you want this pre or post 593?

> cc: Warning: sv.c, line 6548: In this statement, the referenced type of
> the pointer value "((char ...)ptr)" is "char", which is not compatible
> with "unsigned char" because they differ by signed/unsigned attribute.
> (ptrmismatch1)
>         PerlIO_set_ptrcnt(fp, (STDCHAR*)ptr, cnt); /* deregisterize cnt
> and ptr */
> --------^
> cc: Warning: sv.c, line 6593: In this statement, the referenced type of
> the pointer value "((char ...)ptr)" is "char", which is not compatible
> with "unsigned char" because they differ by signed/unsigned attribute.
> (ptrmismatch1)
>     PerlIO_set_ptrcnt(fp, (STDCHAR*)ptr, cnt);  /* put these back or
> we're in trouble */
> ----^
> 
> But for some reason I can't right now figure out, the detection of
> the stdio char (un)signedness (grepping for 'unsigned.*char.*_ptr;'
> in cpp-expanded <stdio.h>) as it is now implemented doesn't work in
> Tru64.  In other words, this:
> 
> 	echo '#include <stdio.h>' | $cppstdin $cppminus > stdio.h
> 
> is not end-result-equivalent to
> 
> 	echo '#include <stdio.h>' > stdio.c
> 	$cppstdin $cppminus < stdio.c > stdioh
> 
> In the first case the stdioh ends up being an empty file!
> In the second case the stdioh ends up being what it should be.
> (The second way is how $cppstdin $cppminus is mostly used elsewhere
> in Configure.)
> 
> From Bourne shell command line both work the same, but inside Configure
> the first one doesn't. (In Tru64 the stdio char is unsigned, but since
> that cannot quite be found from the empty stdioh, Configure guesses
> signed.) (The "non-workingness" of the first case almost makes me
> suspect a bug in the Tru64 /bin/sh.)
> 
> But I boldly suggest that everyone using Configure will start
> doing the grep the second way since that would suit Tru64 :-)
> (Another option, explicitly hinting dec_osf.sh would be more of a cheat,
> methinks.)  The attached patch implements the bold option.

-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using Perl 5.6.2, 5.8.0, 5.8.5, & 5.9.2  on HP-UX 10.20, 11.00 & 11.11,
 AIX 4.3 & 5.2, SuSE 9.2 & 9.3, and Cygwin. http://www.cmve.net/~merijn
Smoking perl: http://www.test-smoke.org,    perl QA: http://qa.perl.org
 reports  to: smokers-reports@perl.org,                perl-qa@perl.org

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About