Comments (5)
Could you please check that upstream bison doesn't produce such warning (under linux)?
If it doesn't produce a warning I should investigate that's the difference, otherwise please report that problem to upstream bison project to fix.
from winflexbison.
Sorry, I don't have a *nix development environment available at the moment.
It will take me some time to get one up (using VirtualBox) to do a quick test.
But when I find the time for it I will report all details to upstream bison and mention the results here.
Kind regards,
Andre.
from winflexbison.
LexerInput() is a virtual function, right? So, you must have provided the code.
The return value for LexerInput is an int from 0..max_size. The way you coded your call to read() guarantees that the value from gcount() must be less than max_size and thus, must fit in an int. So, you should cast the result of gcount() to int and return an int as expected by the flex interface conventions.
This issue is due to the user defined code and should be closed.
from winflexbison.
LexerInput() is a virtual function, right? So, you must have provided the code.
No,that is generated by flex or in this case win_flex into scanner.cc and also prototyped in FlexLexer.h.
The referenced sample has those pre-generated / shipped and back then it all was of type int
, too.
Current flex still has that as an int, and the current cpp skeleton also returns yyin.gcount()
. So we are "identical to upstream.
There is currently no actual issue as the stream reads up to the max_size, which is also an int, the implementation would be completely broken if it returns anything bigger.
Depending on the actual environment std::istream::gcount()
is defined differently because it is of type streamsize
, MSVC defines that depending on the compilation of 32/64 bit:
#ifdef _WIN64
typedef __int64 streamsize;
#else
typedef int streamsize;
#endif
So the requested change for long long
would be wrong for winflexbison.
But MSVC is not the only one that not always uses int
, so an upstream change is reasonable.
I think the skeleton should be changed to explicit cast to the return code:
- return yyin.gcount();
+ return (int)yyin.gcount();
Upstream merge-request: westes/flex#495.
from winflexbison.
Thanks. The flex docs mentioned that it was a virtual function. I should have checked to see if any of the skeletons defined it.
Agreed that this is an upstream issue and that, as we both said, the appropriate fix is casting the gcount() result to int.
from winflexbison.
Related Issues (20)
- Bison-3.7.2 HOT 2
- v2.5.23 not working on Windows XP HOT 25
- Can not fix file via --update HOT 16
- Crash on invalid input HOT 6
- Visual Studio - win_bison creates tab.h file exceeding compiler limits HOT 8
- Update to bison 3.7.4 HOT 10
- Trouble compiling a *.l file using CMake HOT 7
- %option c++ is not compatible with %option noyywrap - linker error: multiple definition HOT 5
- Install guide lines? HOT 3
- Update to Bison 3.8.1 HOT 11
- Missing LICENSE/COPYING file in repository toplevel HOT 6
- Cannot compile Bison input in C++ mode HOT 2
- Visual Studio dependencies and the provided CustomBuildRules HOT 3
- Could this project build with gcc HOT 2
- Runtime error when running multiple flex processes HOT 19
- D language support fixes reported upstream
- Using api.prefix{ ... } breaks yyerror()
- Chocolatey for 2.5.25 (Bison 3.8) HOT 1
- BSD license and GPL license missing from the binary package
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winflexbison.