> /home/riastradh/netbsd/current/src/lib/libc/ssp/stpncpy_chk.c:46:1: error: no 
> previous prototype for '__stpncpy_chk' [-Werror=missing-prototypes]
>    46 | __stpncpy_chk(char * __restrict dst, const char * __restrict src, 
> size_t len, 
>       | ^~~~~~~~~~~~~

> I made progress after the first one by adding

> char *__stpncpy_chk(char *, const char *, size_t, size_t);

> to include/ssp/string.h but I'm baffled how this could possibly work
> because the definition in lib/libc/ssp/stpncpy_chk.c has __restrict
> qualifiers, which should surely be rejected given this prototype, no?

No, char * in the prototype should be compatible with char * restrict
in the definition, especially in view of what restrict actually means.
(It should also be compatible with char * const and the like; don't
confuse char * X with X char *.)

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mo...@rodents-montreal.org
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Reply via email to