Traffic Server
  1. Traffic Server
  2. TS-215

remove ink_*printf fucntions from libinktomi++

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.0
    • Component/s: Cleanup
    • Labels:
      None

      Description

      These function have become wrappers around vsnprintf and vsprintf and don't add functionality.
      ink_snprintf, ink_sprintf, ink_vsnprintf, and ink_vsprintf

      ink_fprintf and ink_vfprintf are just wrappers around vfprintf

      ink_printf has become a wrapper around ink_vfprintf and can be removed too.

      We can possible remove these too:
      ink_bsprintf, ink_bvsprintf

      1. 001-printf-bcall.patch
        319 kB
        Bryan Call
      2. 002-printf-bcall.patch
        296 kB
        Bryan Call

        Activity

        Hide
        Bryan Call added a comment -

        Updated the patch to work on the current trunk...

        Show
        Bryan Call added a comment - Updated the patch to work on the current trunk...
        Hide
        Bryan Call added a comment -

        Updates to remove ink_*printf functions.

        We still need ink_bsprintf and ink_bvsprintf, because of:
        Concerning the return value of snprintf(), SUSv2 and C99 contradict
        each other: when snprintf() is called with size=0 then SUSv2 stipulates
        an unspecified return value less than 1, while C99 allows str to be
        NULL in this case, and gives the return value (as always) as the number
        of characters that would have been written in case the output string
        has been large enough.

        We rely on passing a NULL to ink_bvsprintf and getting the size of the string we need to allocate. Not efficient, but this feature is used. I didn't know if OpenSolaris or other OSes follow the SUSv2 spec.

        Show
        Bryan Call added a comment - Updates to remove ink_*printf functions. We still need ink_bsprintf and ink_bvsprintf, because of: Concerning the return value of snprintf(), SUSv2 and C99 contradict each other: when snprintf() is called with size=0 then SUSv2 stipulates an unspecified return value less than 1, while C99 allows str to be NULL in this case, and gives the return value (as always) as the number of characters that would have been written in case the output string has been large enough. We rely on passing a NULL to ink_bvsprintf and getting the size of the string we need to allocate. Not efficient, but this feature is used. I didn't know if OpenSolaris or other OSes follow the SUSv2 spec.

          People

          • Assignee:
            Bryan Call
            Reporter:
            Bryan Call
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development