AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:
CFG:
PT:0
S:andy.sharp@lsi.com
RQ:
SSV:mhbs.lsil.com
NSV:
SSH:
R:<Larry.Scheer@lsi.com>
MAID:2
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/LSI/INBOX	0	DEC609CD0E54B2448DAF023C89AE9755E9275ABF@cosmail02.lsi.com
X-Sylpheed-End-Special-Headers: 1
Date: Wed, 2 Dec 2009 10:39:45 -0800
From: Andrew Sharp <andy.sharp@lsi.com>
To: "Scheer, Larry" <Larry.Scheer@lsi.com>
Subject: Re: How did you compile elog-munger.c?
Message-ID: <20091202103945.2823d25d@ripper.onstor.net>
In-Reply-To: <DEC609CD0E54B2448DAF023C89AE9755E9275ABF@cosmail02.lsi.com>
References: <DEC609CD0E54B2448DAF023C89AE9755E9275ABF@cosmail02.lsi.com>
Organization: LSI
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

a) don't compile it 32 bit
b) see (a)

On Tue, 1 Dec 2009 20:08:14 -0700 "Scheer, Larry"
<Larry.Scheer@lsi.com> wrote:

> Andy,
>    When I try to compile elog-munger.c for a 32 bit system I get the
> following compile error:
> 
>  gcc -m32 elog-munger.c -o elog-munger32
> elog-munger.c: In function 'hunt_for_paren':
> elog-munger.c:56: error: case label does not reduce to an integer
> constant
> 
> How did you get this to compile?
> 
> /*
>  * this function helps eliminate false matches to macros who's names
>  * begin with the macro we're looking for, but are not the macro
>  * we're looking for. or false matches to the name of our macro
>  * in a comment and whatnot.
>  *
>  * return 0 if this is indeed the macro we're looking for
>  *
>  */
> int
> hunt_for_paren(char *wstart, char *pat, char paren)
> {
>     char *a = &wstart[strlen(pat)];
> 
>     /* quick optimization ~:^) */
>     if (*a == '(') {
>         return 0;
>     }
> 
>     while (*a && *a != paren) {
>         switch (*a) {
>             case ' ':
>             case '\t':
>                 a++;
>             case paren:
>                 continue;
>             default:
>                 return 1;
>         }
>     }
> 
>     if (*a == paren) {
>         return 0;
>     }
> 
>     /*
>      * got to end of string with no paren!
>      * opening paren of macro must be on same line, i guess...
>      */
>     return 1;
> }
