Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 May 2008 01:35:04 -0400
From:      David Schultz <das@FreeBSD.ORG>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        Peter Jeremy <peterjeremy@optushome.com.au>, Alfred Perlstein <alfred@FreeBSD.ORG>, src-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-src@FreeBSD.ORG
Subject:   Re: cvs commit: src/include stdio.h src/lib/libc/stdio clrerr.c feof.c ferror.c fileno.c getc.c getchar.c local.h putc.c putchar.c xprintf.c
Message-ID:  <20080506053504.GA66588@zim.MIT.EDU>
In-Reply-To: <200805051637.43073.jhb@freebsd.org>
References:  <200805051603.m45G3rrN089219@repoman.freebsd.org> <200805051459.29200.jhb@freebsd.org> <20080505192417.GS7293@server.vk2pj.dyndns.org> <200805051637.43073.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, May 05, 2008, John Baldwin wrote:
> On Monday 05 May 2008 03:24:17 pm Peter Jeremy wrote:
> > On Mon, May 05, 2008 at 02:59:28PM -0400, John Baldwin wrote:
> > >On Monday 05 May 2008 02:40:03 pm Alfred Perlstein wrote:
> > >> I'm _not_ objecting, just interested in why.
> > >> 
> > >> Any references to discussions on this?  Are we now safe for
> > >> future compat or something?
> > >
> > >Having FILE be opaque broke just about every 'configure' script on the 
> > >planet. :(
> > 
> > Either autoconf and friends are _intended_ as impediments to
> > portability or they are completely broken by design.
> 
> It appears that autoconf only believes a type is real if you can typedef it to 
> another type, cast 0 to a valid pointer to the new typedef'd type, and do a 
> sizeof() of the typdef'd type.  The last is where having an opaque type 
> breaks down for scripts that want to make sure FILE is a real type.

I believe FILE is required to be a complete type, but it need not
expose any usable fields to applications. For instance,

       typedef struct { char __pad[__FILE_LENGTH]; } FILE;

would be valid. I don't know whether that breaks lots of apps or
not. Of course that still makes it possible to write bogus apps
that depend on sizeof(FILE).



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080506053504.GA66588>