VTR won't compile on cygwin due to use of strdup and strnlen in two ODIN-II files: netlist_visualizer.cpp and soft_logic_parser_def.cpp.
Neither strdup nor strnlen is standard C, so we should not use them.
Expected Behaviour
Should compile on cygwin.
Current Behaviour
Compiler errors in these files, due to undefined functions.
Possible Solution
Replace strdup calls with vtr::strdup. (everywhere else in VTR we call this function that we control).
Replace strnlen with strlen, and min the result with 65 if necessary (that's what the current code does).
(Optional, but would be good). It would be best to get rid of the hardcoded 65, and the earlier hardcoded bufsize of 64 in soft_logic_parser_def.cpp and replace them with a #define LOGIC_PARSER_BUFSIZE or some such, as these hard coded numbers are bad. Probably best to use a bigger buffer size too; using a small buffer like 64/65 characters isn't a great idea even if you don't think people will use long names as the cost of a 8192 or so entry buffer is 0 negligible anyway.
Steps to Reproduce
Compile on cygwin.
Context
Two users, David Lewis and Igor Ilyukhin, have hit those in the past two weeks.
VTR won't compile on cygwin due to use of strdup and strnlen in two ODIN-II files: netlist_visualizer.cpp and soft_logic_parser_def.cpp.
Neither strdup nor strnlen is standard C, so we should not use them.
Expected Behaviour
Should compile on cygwin.
Current Behaviour
Compiler errors in these files, due to undefined functions.
Possible Solution
Steps to Reproduce
Compile on cygwin.
Context
Two users, David Lewis and Igor Ilyukhin, have hit those in the past two weeks.
Your Environment
Trunk VTR (recent as of July 20, 2018) Gcc Cygwin