From: Paul Tan Date: Wed, 01 Jul 2015 06:04:13 GMT Subject: Re: [PATCH v4 01/44] wrapper: implement xopen() Message-ID: In-Reply-To: <5590CE10.3020104@web.de> On Mon, Jun 29, 2015 at 12:48 PM, Torsten Bögershausen wrote: > - Having xopen() with 2 or 3 parameter is good, but the current may need > some tweaks for better portability: > > int xopen(const char *path, int oflag, ...) > { > mode_t mode = 0; > if (oflag & O_CREAT) { > va_list ap; > va_start(ap, oflag); > mode = va_arg(ap, int); > va_end(ap); > > } > > See e.g. > > why va_arg(ap, int) should be used: Ah OK. I've learned about yet another dark corner of C :-). Thanks, Paul