Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Sep 2016 09:30:08 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-doc@FreeBSD.org
Subject:   [Bug 212724] function signatures in man page missing the "restrict" keyword
Message-ID:  <bug-212724-9@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212724

            Bug ID: 212724
           Summary: function signatures in man page missing the "restrict"
                    keyword
           Product: Documentation
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Documentation
          Assignee: freebsd-doc@FreeBSD.org
          Reporter: ori@avtalion.name

When a function has the "restrict" keyword, it is usually mentioned in the
manpage.

Some man pages omit it. For example, strtok:

strok has the signature [1]:

  char *strtok(char * __restrict, const char * __restrict);

The manpage lists it as [2]:
  char * strtok(char *str, const char *sep);

It should be:
  char * strtok(char * restrict str, const char * restrict sep);

[1]
https://github.com/freebsd/freebsd/blob/b8aaa2c367f1038f28506521674b9b40b8a=
51352/include/string.h#L119
[2]
https://github.com/freebsd/freebsd/blob/b8aaa2c367f1038f28506521674b9b40b8a=
51352/lib/libc/string/strtok.3#L58


A few other functions in string.h that use "restrict", but omit it in their=
 man
pages:
* memccpy
* memcpy
* stpcpy
* stpncpy
* strlcat
* strncat
* strncpy

memcpy is interesting: Its documentation says it uses bcopy, and therefore =
the
strings may overlap. However, the signature in string.h includes the "restr=
ict"
keywords.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-212724-9>