|
From: Larry D. <ldo...@re...> - 2015-07-23 03:40:54
|
Friends -
I see a bunch of commits from Frederick C. Kurz to let iverilog run
smoothly on "Microsoft Visual Studio Express 2015 RC Web".
I appreciate the value in making the iverilog code base usable for
more people and environments.
Some of the patches look terrible, in the sense of duplicating
code and introducing maintenance headaches, as well as adding
cognitive load on the developers from all the #ifdef's. Could we
go through and try to get the same result with better coding style?
One simple and concrete suggestion: suppose we
#ifdef __GNUC__
#define MAYBE_UINT
#else
#define MAYBE_UNIT : unsigned int
#endif
somewhere. Then commits 82d46a5e and 093e7eb2 could be accomplished
without further conditional code, just changing
typedef enum ivl_variable_type_e {
to
typedef enum ivl_variable_type_e MAYBE_UINT {
etc. If tests show that gcc and clang give the same result on normal
computers _with_ the enumeration based on unsigned int, even that one
bit of conditional magic could be eliminated.
I don't know anything about this, but I wonder if Frederick looked
for something equivalent to "--std=c99" in MVSE2015RCW? It's hard
to believe a compiler today (especially one with 2015 in its name)
really needs commit 5e931b7e.
- Larry
|