|
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
|
|
From: Stephen W. <st...@ic...> - 2015-07-23 14:38:36
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Yeah, some of hthem I would have done better and I may go back
and clean some of them up a bit. If anyone beats me to that, then
that's great.
On 07/22/2015 08:40 PM, Larry Doolittle wrote:
> 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
>
> ------------------------------------------------------------------------------
>
>
_______________________________________________
> Iverilog-devel mailing list Ive...@li...
> https://lists.sourceforge.net/lists/listinfo/iverilog-devel
>
- --
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEARECAAYFAlWw/F4ACgkQrPt1Sc2b3ikl6gCg7d+kGfRIaP1MaFzZEIPJuYbf
tVUAoN1kqVpqy17zyZ7qEOXLObn3D4Xl
=NIFc
-----END PGP SIGNATURE-----
|
|
From: Cary R. <cy...@ya...> - 2015-07-27 05:41:28
|
The other issue is we also compile using clang so __GNUC__ does not likely work for all cases. I have not looked at this to check if there are issues, but I'm guessing we may need an #ifdef for MSVC just like we have for mingw.
Cary
On Thursday, July 23, 2015 7:38 AM, Stephen Williams <st...@ic...> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Yeah, some of hthem I would have done better and I may go back
and clean some of them up a bit. If anyone beats me to that, then
that's great.
On 07/22/2015 08:40 PM, Larry Doolittle wrote:
> 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
>
> ------------------------------------------------------------------------------
>
>
_______________________________________________
> Iverilog-devel mailing list Ive...@li...
> https://lists.sourceforge.net/lists/listinfo/iverilog-devel
>
- --
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEARECAAYFAlWw/F4ACgkQrPt1Sc2b3ikl6gCg7d+kGfRIaP1MaFzZEIPJuYbf
tVUAoN1kqVpqy17zyZ7qEOXLObn3D4Xl
=NIFc
-----END PGP SIGNATURE-----
------------------------------------------------------------------------------
_______________________________________________
Iverilog-devel mailing list
Ive...@li...
https://lists.sourceforge.net/lists/listinfo/iverilog-devel
|
|
From: Larry D. <ldo...@re...> - 2015-07-28 03:14:00
|
Cary - On Mon, Jul 27, 2015 at 05:38:35AM +0000, Cary R. wrote: > The other issue is we also compile using clang so __GNUC__ does not likely work for all cases. I have not looked at this to check if there are issues, but I'm guessing we may need an #ifdef for MSVC just like we have for mingw. I agree in general, and of course this needs some thought and testing. It turns out clang does define __GNUC__, as shown here on Debian Jessie: $ clang --version Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) Target: x86_64-pc-linux-gnu Thread model: posix $ clang -dM -E - < /dev/null | grep GNU #define __GNUC_MINOR__ 2 #define __GNUC_PATCHLEVEL__ 1 #define __GNUC_STDC_INLINE__ 1 #define __GNUC__ 4 $ - Larry |
|
From: Cary R. <cy...@ya...> - 2015-07-31 22:47:44
|
Thanks for looking into this Larry. I was able to compile Icarus and run the test suite to verify that things still work correctly with clang. Cary On Monday, July 27, 2015 8:13 PM, Larry Doolittle <ldo...@re...> wrote: Cary - On Mon, Jul 27, 2015 at 05:38:35AM +0000, Cary R. wrote: > The other issue is we also compile using clang so __GNUC__ does not likely work for all cases. I have not looked at this to check if there are issues, but I'm guessing we may need an #ifdef for MSVC just like we have for mingw. I agree in general, and of course this needs some thought and testing. It turns out clang does define __GNUC__, as shown here on Debian Jessie: $ clang --version Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) Target: x86_64-pc-linux-gnu Thread model: posix $ clang -dM -E - < /dev/null | grep GNU #define __GNUC_MINOR__ 2 #define __GNUC_PATCHLEVEL__ 1 #define __GNUC_STDC_INLINE__ 1 #define __GNUC__ 4 $ - Larry |