Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: What is the difference between (r+ and w+) Date: Sun, 18 Jun 2017 15:14:41 -0700 Organization: None to speak of Lines: 30 Message-ID: References: <87h8zd4d9n.fsf@bsb.me.uk> <5946b81e.645125@news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="6cbb5d51c319bdfdc6c4f737cfea8267"; logging-data="23998"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189DLV3ZvtKBxsFjX/ofn7t" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:yh1GZNrVWB16k8bpD8eWkmUIDss= sha1:LgRzt7XoQRZ3aehM5amzKvauZmw= Xref: csiph.com comp.lang.c:112507 Lew Pitcher writes: > Lew Pitcher wrote: [...] >> Thanks, but I don't need luck; I know how to program. And, yes, I can "run >> printf()" without including stdio.h in my code... >> >> 17:10 $ cat nostdio.c >> int printf(char *, ...); [snip] > And, before the more knowledgable C programmers of the group point out my > mistake in the prototype for printf(), you can have... > > 17:14 $ cat nostdio.c > int printf(const char *, ...); I'd use: int printf(const char * restrict format, ...); unless I had to worry about pre-C99 compilers. It's likely I could get away with omitting "const" and/or "restrict", but it's easier to copy the standard declaration than to think about what changes I can get away with. (All this assumes I have some reason not to use #include .) -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"