[Flex-help] YY_INPUT typing compatibility between 2.5 and 2.6
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Daniel L. <fu...@st...> - 2019-07-16 22:44:13
|
Hi, I'm trying to help a friend set up autoconf on their project which uses flex. I've encountered a kind of a funny situation which is probably quite easy to handle, but I don't see the right way to handle it. It has to do with his definition of YY_INPUT, which looks like this: #define YY_INPUT(buf,result,max_size) fussy_inp(buf,&result,max_size) Later on, he has the function definition: void fussy_inp(char *buf, int *result, int max_size) { ... Under flex 2.5, this is the right prototype, but under 2.6 it seems to want yy_size_t* instead. I feel like the right thing to do might be to make it a macro instead of a function, but it does some significant computation and has a static variable in it, so if I could leave it as a function I'd be happier. At first I thought I'd use AC_CHECK_TYPE to see if yy_size_t exists but I think it does exist in 2.5. My next guess was to try checking the type of a struct member, but this is getting to be a hairy amount of code in autoconf and I thought I'd check here and see if I'm missing something obvious first. https://stackoverflow.com/questions/52296527/autoconf-check-struct-member-type Thanks, -- Daniel Lyons |