problem building g15composer

I am trying to create a g15composer package with OBS
The build fails with the compiler error
E: g15composer 64bit-portability-issue g15composer.c:136

Note: This fails only for openSUSE releases of 11.1 and higher.

Re: problem building g15composer

Hmm the only thing i can think of that's odd with that is that you're using a macro for accessing the data (seems kinda unnecessary to bind yyin to yyg->yyin_r)
But nevertheless, as the preprocessor handles all macros, it shouldn't cause trouble. Could always try without it thou :)

Re: problem building g15composer

So, in g15composer.lex.c yyget_in is defined thusly:

FILE *yyget_in  (yyscan_t yyscanner)<br />
{<br />
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;<br />
    return yyin;<br />
}

which sure does seem like it should return a FILE *. yyin is defined as a macro like this:

#define yyin yyg->yyin_r

and in the struct yyguts_t def we have yyin_r defined as a FILE *:

FILE *yyin_r, *yyout_r;

So, I'm quite confused as to where it is going wrong. Here's the warning I was talking about when trying to cast yyget_in to a FILE *:

g15composer.c: In function 'threadEntry':<br />
g15composer.c:136: warning: cast to pointer from integer of different size

Re: problem building g15composer

That sounds weird. Really weird. You should check if yyget_in just tries to cast an int to a file and return that, then that might cause some trouble, just like that.

Re: problem building g15composer

Yup, tried that, gave me a warning about the integer and pointer sizes not matching. I had thought yyget_in() returns a FILE * too, but I guess not.

Re: problem building g15composer

(FILE *) ?
Tried casting it like that :P? (Just took a quick look at what yyget_in returns, and it should be FILE *, but who knows)

Re: problem building g15composer

Unfortunately I have no control of the parser.

Re: problem building g15composer

You must have stricter compiler settings than I do, I only get a warning:

g15composer.c: In function 'threadEntry':<br />
g15composer.c:136: warning: passing argument 1 of 'fclose' makes pointer from integer without a cast

I think this is one of those strange artifacts of the way pure parsers work with Bison. I've not yet encountered a problem with it on a 64-bit Gentoo system, so perhaps if you can relax the compiler strictness you will be fine. If you have a suggestion for fixing it I'm also open to that. Thanks.