Message ID | CALoOobPwKv003N5BMcPQ+QThRkfpk9s5Ev86srZa+JuCSvf6DA@mail.gmail.com |
---|---|
State | New |
Headers | show |
On 08/01/2015 06:27 PM, Paul Pluzhnikov wrote: > The following trivial patch fixes this: LGTM for 2.23, which is now open. Falls under the obvious category for including a header for a function you use. c. > diff --git a/libio/oldfileops.c b/libio/oldfileops.c > index 54789b2..25797c8 100644 > --- a/libio/oldfileops.c > +++ b/libio/oldfileops.c > @@ -41,6 +41,7 @@ > #include <string.h> > #include <errno.h> > #include <stdlib.h> > +#include <unistd.h> > #ifndef errno > extern int errno; > #endif > > Ok to commit above? > > After that, make check: > > XPASS: conform/ISO11/complex.h/conform > XPASS: conform/ISO11/stdalign.h/conform > XPASS: conform/ISO11/stdnoreturn.h/conform > FAIL: elf/tst-protected1a > FAIL: elf/tst-protected1b > > As far as I understand, the tst-protected1{a,b} are expected to fail > with binutils 2.24-5ubuntu13 > >
On Wed, Aug 5, 2015 at 12:15 AM, Carlos O'Donell <carlos@redhat.com> wrote: > On 08/01/2015 06:27 PM, Paul Pluzhnikov wrote: >> The following trivial patch fixes this: > > LGTM for 2.23, which is now open. Falls under the obvious category > for including a header for a function you use. Hmm, for some reason I can't reproduce this anymore, and unistd.h is already included indirectly. I don't understand why that's happening. But it still seems like a good idea from header hygiene perspective.
> Hmm, for some reason I can't reproduce this anymore, and unistd.h is > already included indirectly. > > I don't understand why that's happening. But it still seems like a > good idea from header hygiene perspective. It is definitely correct (and in the "obvious" category) to have each source file explicitly #include the header that is the canonical declarator of each symbol that source file uses directly.
On Thu, Aug 6, 2015 at 12:55 AM, Roland McGrath <roland@hack.frob.com> wrote: > > > Hmm, for some reason I can't reproduce this anymore, and unistd.h is > > already included indirectly. > > > > I don't understand why that's happening. But it still seems like a > > good idea from header hygiene perspective. > > It is definitely correct (and in the "obvious" category) to have each > source file explicitly #include the header that is the canonical declarator > of each symbol that source file uses directly. committed as 2ba30a182ca50ac07f45ed1f813a85ccafaed85d Thanks,
diff --git a/libio/oldfileops.c b/libio/oldfileops.c index 54789b2..25797c8 100644 --- a/libio/oldfileops.c +++ b/libio/oldfileops.c @@ -41,6 +41,7 @@ #include <string.h> #include <errno.h> #include <stdlib.h> +#include <unistd.h> #ifndef errno extern int errno; #endif