Re: Compiling kernel with -std=gnu11

Mouse <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
> /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		[email protected]
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.