Axis2-C
  1. Axis2-C
  2. AXIS2C-1483

broken due to AXIS2_UNZOPEN2 change in axutil_unix.h

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: platforms/unix
    • Labels:
      None
    • Environment:
      linux

      Description

      Axis2/C build break when built with --with-archive=/usr/include option, due to following change.
      -define AXIS2_UNZOPEN2(zipfilename,ffunc) unzOpen2(zipfilename,NULL); memset(&ffunc, 0, sizeof(ffunc));
      +define AXIS2_UNZOPEN2(zipfilename,ffunc) do

      { unzOpen2(zipfilename,NULL); memset(&ffunc, 0, sizeof(ffunc)); }

      while (0)

      why do we need a while loop here?

        Activity

        Hide
        Damitha Kumarage added a comment -

        Yes having two staements in one define is dangerous. I fixed this issue by using a block statement.

        — util/include/platforms/os400/axutil_os400.h (revision 960420)
        +++ util/include/platforms/os400/axutil_os400.h (working copy)
        @@ -258,7 +258,11 @@

        /** minizip functions */
        #define axis2_fill_win32_filefunc(ffunc)
        -#define AXIS2_UNZOPEN2(zipfilename,ffunc) do

        { unzOpen2(zipfilename,NULL); memset(&ffunc, 0, sizeof(ffunc)); }

        while (0)
        +#define AXIS2_UNZOPEN2(zipfilename, ffunc, uf) \
        +

        { \ + uf = unzOpen2(zipfilename,NULL); \ + memset(&ffunc, 0, sizeof(ffunc)); \ + }
        Show
        Damitha Kumarage added a comment - Yes having two staements in one define is dangerous. I fixed this issue by using a block statement. — util/include/platforms/os400/axutil_os400.h (revision 960420) +++ util/include/platforms/os400/axutil_os400.h (working copy) @@ -258,7 +258,11 @@ /** minizip functions */ #define axis2_fill_win32_filefunc(ffunc) -#define AXIS2_UNZOPEN2(zipfilename,ffunc) do { unzOpen2(zipfilename,NULL); memset(&ffunc, 0, sizeof(ffunc)); } while (0) +#define AXIS2_UNZOPEN2(zipfilename, ffunc, uf) \ + { \ + uf = unzOpen2(zipfilename,NULL); \ + memset(&ffunc, 0, sizeof(ffunc)); \ + }
        Hide
        nadir amra added a comment -

        Becaue it is inheritnly dangerouse to specify 2 statements in one define, specifially when used in an if-statement as follows:

        if (xxx)
        AXIS2_UNZOPEN2(zipfilename,ffunc);

        I will look at where it is used and fix it.

        Show
        nadir amra added a comment - Becaue it is inheritnly dangerouse to specify 2 statements in one define, specifially when used in an if-statement as follows: if (xxx) AXIS2_UNZOPEN2(zipfilename,ffunc); I will look at where it is used and fix it.

          People

          • Assignee:
            Unassigned
            Reporter:
            Damitha Kumarage
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development