Menu

#6 ISO C90 compliance

closed-accepted
None
2015-05-12
2015-05-06
No

Hi,

hexcompare is cool software, but unfortunately its source code is not strictly ANSI-C compatible, which makes it way less portable than it could be.

Reasons:

  • mixes variable declarations with code
  • uses stack-allocated arrays of dynamic size
  • contains plenty of 'modern' comments (// style)

Also, for some reason the Makefile was using a bit "exotic" targets, which made GNU make unable to properly detect changes in source code during build time.

I fixed all the above, and produced the patch attached to this report. I hope you will like it.

By the way, is there any chance that you'd set up a svn repo with hexcompare? Sourceforge provides a SVN facility, so it would be a single-click operation, and it would be really nice to have a proper trunk/tags tree with hexcompare's versioning.

1 Attachments

Discussion

  • Mateusz Viste

    Mateusz Viste - 2015-05-06

    ...and here is a better version of the patch, where I also cleaned up all function declarations to remove all unused variables (otherwise gcc likes to complain).

    Now hexcompare compiles with -Wall -Wextra -pedantic without raising any warning.

     
  • Mateusz Viste

    Mateusz Viste - 2015-05-06

    one additional note (that's the last one, I promise!): the Makefile links hexcompare with the math lib (-lm), while hexcompare doesn't use any math function. Therefore the -lm option can be safely removed.

     
  • Mateusz Viste

    Mateusz Viste - 2015-05-12
    • status: open --> closed-accepted
    • assigned_to: Mateusz Viste
     
  • Mateusz Viste

    Mateusz Viste - 2015-05-12

    Thanks for your contribution, Mateusz. I applied your patch to the upstream svn right now. I also removed the -lm library linking from the Makefile as you suggested.

     

Log in to post a comment.