From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5959 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: C threads, v. 6.2 Date: Thu, 28 Aug 2014 13:41:43 +0200 Message-ID: <20140828114142.GC22308@port70.net> References: <1409177505.4476.75.camel@eris.loria.fr> <20140827234657.GW12888@brightrain.aerifal.cx> <1409218850.4476.96.camel@eris.loria.fr> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1409226124 4730 80.91.229.3 (28 Aug 2014 11:42:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Aug 2014 11:42:04 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5966-gllmg-musl=m.gmane.org@lists.openwall.com Thu Aug 28 13:41:57 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XMy5U-00026L-Aa for gllmg-musl@plane.gmane.org; Thu, 28 Aug 2014 13:41:56 +0200 Original-Received: (qmail 20041 invoked by uid 550); 28 Aug 2014 11:41:55 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 20033 invoked from network); 28 Aug 2014 11:41:55 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <1409218850.4476.96.camel@eris.loria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:5959 Archived-At: * Jens Gustedt [2014-08-28 11:40:50 +0200]: > Am Mittwoch, den 27.08.2014, 19:46 -0400 schrieb Rich Felker: > > On Thu, Aug 28, 2014 at 12:11:45AM +0200, Jens Gustedt wrote: > > > +#define _Nonnull(...) __attribute__((__nonnull__(__VA_ARGS__))) > > > +#else > > > +#define _Nonnull(...) > > > +#endif > > > > If we want to use attributes like this, it's a separate change from > > adding threads. But I'm fairly much against doing it anyway since the > > compiler already knows how to make these warnings for standard > > functions, without help from the headers. > > There will be a while, until compilers know these things for C11 > thread functions, I think. > > BTw, I was tempted to do it the "C" way by using things like > `[static 1]` instead of `*`, but then I thought you wouldn't like > that. > hm i think [static 1] would be better than a gcc specific attribute but gcc <=4.9 and clang <=3.1 don't seem to warn about 0 argument then (we could still use it though) probably should be reported to gcc devs > > > +int thrd_sleep(const struct timespec *req, struct timespec *rem) > > > +{ > > > + int ret = __syscall(SYS_nanosleep, req, rem); > > > + // compile time comparison, constant propagated > > > + if (EINTR != 1) { > > > + switch (ret) { > > > + case 0: return 0; > > > + /* error described by POSIX: */ pls use tabs for those of us who are used to 8 width indent