bug-m4
[Top][All Lists]
Advanced

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

Re: HEAD: inclusion order wrong for input.c


From: Gary V. Vaughan
Subject: Re: HEAD: inclusion order wrong for input.c
Date: Mon, 2 Apr 2007 23:37:12 +0100

Hallo Ralf,

On 2 Apr 2007, at 22:49, Ralf Wildenhues wrote:
* Gary V. Vaughan wrote on Mon, Apr 02, 2007 at 08:28:56PM CEST:
On 2 Apr 2007, at 18:45, Ralf Wildenhues wrote:
* Gary V. Vaughan wrote on Mon, Apr 02, 2007 at 02:32:45PM CEST:
Thanks for the report.  Although I don't get this warning, I have
cleaned up the remaining warnings that I did see on OS X.

Thanks, looking better now. I do get these warnings now, with - Wall:

../m4/m4/macro.c: In function 'expand_macro':
../m4/m4/macro.c:279: warning: format '%d' expects type 'int', but
argument 5 has type 'size_t'

This one is waiting for %z support from gnulib (maybe when snprintfv is
fully merged).

Ah, ok, I was merely reporting because it sounded like you assumed there
were no more warnings at all.

../m4/m4/macro.c: In function 'process_macro':
../m4/m4/macro.c:425: warning: array subscript has type 'char'
../m4/m4/macro.c:478: warning: array subscript has type 'char'

Thats because we're using a string pointer dereference to index a 256
element array.  I can't think of a pleasant way to fix that... ideas?

Cast the subscript to unsigned char before using it as index.
Otherwise, on a system where char is signed, and its high bit is set,
and you haven't adjusted the array range to allow for negative values,
fun will ensue.

If the table value for META-^A is held at element 128 of the array (since the table was built assuming char* is unsigned by default), and we compile
on a host with signed chars, does the signed char value of META-^A still
become 128 when cast to unsigned char?  Or does 2's complement come into
play and scramble the order of the negative signed char values when
casting them before doing a table lookup?

Cheers,
        Gary
--
  ())_.              Email me: address@hidden
  ( '/           Read my blog: http://blog.azazil.net
  / )=         ...and my book: http://sources.redhat.com/autobook
`(_~)_ Join my AGLOCO Network: http://www.agloco.com/r/BBBS7912




Attachment: PGP.sig
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]