Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 May 1997 20:56:47 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG, peter@FreeBSD.ORG
Subject:   Re: cvs commit: src/lib/libutil libutil.h
Message-ID:  <199705191056.UAA11773@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>  Modified files:
>    lib/libutil          libutil.h 
>  Log:
>  Now I really understand the reason for the style.9 rule about not having
>  visible type names in prototypes in user space headers.  libutil.h
>  generates warnings with -Wall over the use of "const char *ttyname".
>  It's lucky it wasn't a #define conflict.
>  Is a single '_' prefix acceptable? or does it need to be two?

Two '_'s are only useful for extra defense against broken programs
that #define reserved names.  Two are unnecessary for the same reason
that two are unnecessary for most of the members of the FILE struct -
the opening parentheses in prototypes changes the scope much like the
the opening brace in a struct declaration.

Why did -Wall generate warnings?  It takes -Wshadow to get a warning for
the ttyname in <libutil.h> shadowing the one in <unistd.h>

Bruce



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