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: Matthew Woehlke
Subject: Re: HEAD: inclusion order wrong for input.c
Date: Mon, 02 Apr 2007 15:00:43 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.4.0

Gary V. Vaughan wrote:
../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?

(WCTS) ...an explicit typecast to int doesn't solve this? Seems to work here:

$ gcc -Wall -Wextra -o aci arrayci.c
arrayci.c: In function `main':
arrayci.c:7: warning: array subscript has type `char'
$ gcc -Wall -Wextra -DCAST='(int)(unsigned)' -o aci arrayci.c
$ cat arrayci.c
#ifndef CAST
#define CAST
#endif
int main() {
        char c = 'q';
        char foo[256] = { 0 };
        return foo[CAST c];
}
$

--
Matthew
Vs lbh pna ernq guvf jvgubhg fbsgjner, lbh ner n FREVBHF areq! -- Nqncgrq sebz Znggurj Jva (ivz-qri znvyvat yvfg)





reply via email to

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