#1272 Clean up some more sign-compare issues

closed
nobody
None
4
2014-06-17
2014-06-10
Larry Doolittle
No

The only known problems left are in files imported from gtkwave,
if not for them you could turn on -Wsign-compare.

Assumes c99 for c code, so the scope of for-loop indexes can be made sane.

1 Attachments

Discussion

  • Cary R.
    Cary R.
    2014-06-10

    I know we in general are expecting C99 for the C code, but I don't know if we allowed it only for the simple case mentioned in the configure script or if we are going to allow all of C99. For the most part the current C code does not have definitions in the for loop.

     
    • Cary-

      On Tue, Jun 10, 2014 at 07:19:36PM +0000, Cary R. wrote:

      I know we in general are expecting C99 for the C code, but I don't know if we allowed it only for the simple case mentioned in the configure script or if we are going to allow all of C99. For the most part the current C code does not have definitions in the for loop.

      You'll have to admit it seems silly to ask if we can assume C99, fourteen
      years after the standard was ratified.

      You're right, the existing Icarus code base does not use for-loop declarations,
      with one exception[*].

      If we seriously don't want to use that helpful feature, I can rework
      my patch (and maybe "fix" the exception noted below). Maybe first,
      I should check to see how much c99 syntax has crept into the code base.
      My guess is a lot, even if you don't count //-style comments.

      • Larry

      [*] vpi/sys_display.c:41, and git blame points to someone other than me ;-)

       
      • Cary R.
        Cary R.
        2014-06-10

        I agree and I noticed that inconsistency as well. I think the original reluctance was related to people trying to use Icarus on older hardware, but at some point it seems like that's not something we need to support.

        I have an email into Steve to get his opinion.

         
  • Cary R.
    Cary R.
    2014-06-17

    I have pushed this patch. I will update the comment in the configure script to note that C99 is not optional.

     
  • Cary R.
    Cary R.
    2014-06-17

    • status: open --> closed