Menu

#18 do not include malloc.h on Linux, BSD's

1.0
closed
BSD (1)
2016-04-06
2016-04-03
No

maxicode.c and code1.c include malloc.h, which is not necessary on Linux and BSDs (replaced with stdlib). Actually, BSDs will generate a compilation error. If you look at the other symbologies, they only include malloc.h if MSCVER is defined.

code1.c doesn't use alloca
maxicode.c uses stack if MSCVER is not defined. Otherwise, alloca

Thanks in advance

Related

Tickets: #18

Discussion

  • Harald Oehlmann

    Harald Oehlmann - 2016-04-03

    Thank you for the ticket!

    The two named files "maxicode.c" and "code1.c" do something special for apple::

    #ifdef __APPLE__
    #include <sys/malloc.h>
    

    I removed all references to malloc.h in code1.c and maxicode.c: For Linux, they are not necessary. For Windows, they are not used. The Apple thing feels strange to me, as it should be in all files but not only in two of them.

    Is commit [90407b] ok for you ?
    Thank you for testing, I only checked on Windows

    Harald

     

    Related

    Commit: [90407b]

    • Mark J. Olesen

      Mark J. Olesen - 2016-04-03

      Thanks for the quick turn around. I was able to compile your fix on Linux,
      OpenBSD and FreeBSD.

      Not a biggie, but you might want to consider adding const to is_sane()
      test_sting in common.c/common.h.

      On Sun, Apr 3, 2016 at 2:36 PM, Harald Oehlmann oehhar@users.sf.net wrote:

      Thank you for the ticket!

      The two named files "maxicode.c" and "code1.c" do something special for
      apple::

      ifdef APPLE#include <sys malloc.h=""></sys>

      I removed all references to malloc.h in code1.c and maxicode.c: For Linux,
      they are not necessary. For Windows, they are not used. The Apple thing
      feels strange to me, as it should be in all files but not only in two of
      them.

      Is commit [90407b]
      https://sourceforge.net/p/zint/code/ci/90407bffce16551d0d2b6f28e0872c61be680aec/
      ok for you ?
      Thank you for testing, I only checked on Windows

      Harald

      Status: open
      Milestone: 1.0
      Created: Sun Apr 03, 2016 04:22 AM UTC by Mark J. Olesen
      Last Updated: Sun Apr 03, 2016 04:22 AM UTC
      Owner: nobody

      maxicode.c and code1.c include malloc.h, which is not necessary on Linux
      and BSDs (replaced with stdlib). Actually, BSDs will generate a compilation
      error. If you look at the other symbologies, they only include malloc.h if
      MSCVER is defined.

      code1.c doesn't use alloca
      maxicode.c uses stack if MSCVER is not defined. Otherwise, alloca

      Thanks in advance

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/zint/tickets/18/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Tickets: #18
      Commit: [90407b]

  • Harald Oehlmann

    Harald Oehlmann - 2016-04-04
    • labels: --> BSD
    • status: open --> closed
    • assigned_to: Harald Oehlmann
     
  • Harald Oehlmann

    Harald Oehlmann - 2016-04-04

    Verified by Marc. Thank you. Closed.
    Harald

     
  • Harald Oehlmann

    Harald Oehlmann - 2016-04-06

    some const including the proposed added in commit [0fcf4c]

     

    Related

    Commit: [0fcf4c]


Log in to post a comment.

MongoDB Logo MongoDB