https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212724

            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: o...@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/b8aaa2c367f1038f28506521674b9b40b8a51352/include/string.h#L119
[2]
https://github.com/freebsd/freebsd/blob/b8aaa2c367f1038f28506521674b9b40b8a51352/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 "restrict"
keywords.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-doc@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-doc
To unsubscribe, send any mail to "freebsd-doc-unsubscr...@freebsd.org"

Reply via email to