Qpid Proton
  1. Qpid Proton
  2. PROTON-121

Platform specific code is mixed in with platform independent code

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.5
    • Component/s: proton-c
    • Labels:
      None

      Description

      the function pn_error_from errno() is platform specific and so should not be in error.c which is (everywhere else) purely platform independent.

      It should be moved to a platform (POSIX) specific file (perhaps a file with only this single function).

      The clue for this is the #define POSIX_C_SOURCE at the top of error.c

        Activity

        Hide
        Rafael H. Schloming added a comment -

        this appears to be fixed now

        Show
        Rafael H. Schloming added a comment - this appears to be fixed now
        Hide
        Andrew Stitcher added a comment -

        The file error.c still uses strerror_r(); we still need to review the engine portions and ensure they are only dependent on ANSI C headers.

        Show
        Andrew Stitcher added a comment - The file error.c still uses strerror_r(); we still need to review the engine portions and ensure they are only dependent on ANSI C headers.
        Hide
        Rafael H. Schloming added a comment -

        Is there more work needed for this or can we close it off now?

        Show
        Rafael H. Schloming added a comment - Is there more work needed for this or can we close it off now?
        Hide
        Andrew Stitcher added a comment -

        Committed change removing use of strcasecmp()

        r1422066

        Show
        Andrew Stitcher added a comment - Committed change removing use of strcasecmp() r1422066
        Hide
        Andrew Stitcher added a comment -

        I've committed changes that remove the use of ntohl etc.

        r1420411

        Show
        Andrew Stitcher added a comment - I've committed changes that remove the use of ntohl etc. r1420411
        Hide
        Andrew Stitcher added a comment -

        Another example is the use of strerror_r() which is also not part of ANSI C

        Show
        Andrew Stitcher added a comment - Another example is the use of strerror_r() which is also not part of ANSI C
        Hide
        Andrew Stitcher added a comment -

        Another example is the use of strcasecmp() which again is not part of ANSI C.

        Show
        Andrew Stitcher added a comment - Another example is the use of strcasecmp() which again is not part of ANSI C.
        Hide
        Andrew Stitcher added a comment -

        A good (perhaps the only) example of this is the use of ntohl() in the engine code. ntohl() is part of the BSD sockets API and not defined in ANSI C at all.

        Show
        Andrew Stitcher added a comment - A good (perhaps the only) example of this is the use of ntohl() in the engine code. ntohl() is part of the BSD sockets API and not defined in ANSI C at all.

          People

          • Assignee:
            Andrew Stitcher
            Reporter:
            Andrew Stitcher
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development