This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use mode_t in open and friends
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: Rasmus Villemoes <rv at rasmusvillemoes dot dk>, libc-alpha at sourceware dot org
- Date: Sat, 3 May 2014 11:28:48 +0200
- Subject: Re: [PATCH] Use mode_t in open and friends
- Authentication-results: sourceware.org; auth=none
- References: <87k3afhsua dot fsf at rasmusvillemoes dot dk> <87a9banc4i dot fsf at igel dot home>
On Thu, Apr 24, 2014 at 02:30:21PM +0200, Andreas Schwab wrote:
> Rasmus Villemoes <rv@rasmusvillemoes.dk> writes:
>
> > The sole varargs argument to open and friends has type mode_t, not int.
>
> Varargs use the promoted type, but mode_t traditionally has been
> unsigned short.
>
So which solution do you prefer? Adding a custom type for that as
suggested in sibling threads? What about just adding a cast like
mode = (mode_t) va_arg (arg, int);