Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-1911

Obsolete POSIX functions should not be used

    Details

    • Type: Code Smell Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      Replace this use of the obsolete "xxx" function with a call to "yyy"
    • Default Severity:
      Major
    • Impact:
      Low
    • Likelihood:
      High
    • Default Quality Profiles:
      Sonar way
    • Legacy Key:
      ObsoletePosixFunction
    • Covered Languages:
      C, C++, Objective-C
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      30min
    • CPPCheck:
      obsoleteFunctions.*

      Description

      To ensure future code portability, obsolete POSIX functions should be removed. Those functions, with their replacements are listed below:

      Obsolete Use Instead
      asctime strftime
      asctime_r strftime
      bcmp memcmp
      bcopy memmove memcpy
      bsd_signal sigaction
      bzero memset
      ctime strftime
      ecvt sprintf
      fcvt sprintf
      ftime no replacement function
      gcvt sprintf
      getcontext Rewrite to use POSIX threads.
      gethostbyaddr getnameinfo
      gethostbyname getaddrinfo
      getwd getcwd
      index strchr
      makecontext Rewrite to use POSIX threads.
      mktemp mkstemp
      pthread_attr_getstackaddr pthread_attr_getstack
      pthread_attr_setstackaddr pthread_attr_setstack
      rand_r rand
      rindex strrchr
      scalb scalbln', 'scalblnf' or 'scalblnl' instead of this function
      swapcontext Rewrite to use POSIX threads.
      ualarm 'timer_create', 'timer_delete', 'timer_getoverrun', 'timer_gettime', or 'timer_settime' instead of this function
      usleep 'nanosleep' or 'setitimer' function
      utime utimensat
      vfork fork
      wcswcs wcsstr

        Attachments

          Issue Links

          1.
          C-Family RSPEC-4367 Language-Specification Active Unassigned

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ann.campbell.2 Ann Campbell
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: