[Spice-devel] [PATCH v2 2/2] Fix clang build error on missing <errno.h>
Lukáš Hrázký
lhrazky at redhat.com
Wed Jul 18 10:07:52 UTC 2018
On Wed, 2018-07-18 at 04:57 -0400, Frediano Ziglio wrote:
> >
> > On Tue, Jul 17, 2018 at 05:56:15PM +0200, Christophe de Dinechin wrote:
> > > From: Christophe de Dinechin <dinechin at redhat.com>
> > >
> > > Using errno requires <errno.h>. Some platforms/compilers
> > > are stricter than others in this respect.
> > >
> > > frame-log.cpp:27:96: error: use of undeclared identifier 'errno'
> > > throw Error(std::string("Failed to open log file '") + log_name
> > > + "': " + strerror(errno));
> > >
> > > Signed-off-by: Christophe de Dinechin <dinechin at redhat.com>
> > > ---
> > > src/frame-log.cpp | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/src/frame-log.cpp b/src/frame-log.cpp
> > > index 63a8ac0..cc993cd 100644
> > > --- a/src/frame-log.cpp
> > > +++ b/src/frame-log.cpp
> > > @@ -12,6 +12,7 @@
> > > #include <chrono>
> > > #include <cstdarg>
> > > #include <string.h>
> > > +#include <errno.h>
> >
> > I'd try to keep this list alphabetically ordered
> >
>
> Quite a bad rule as hard to maintain. Some header, due to bug or other
> reasons have some order dependency. I remember one system where this
> caused silent ABI breakage causing crashes using variadic arguments.
> Another example in Windows winsock2.h should be included before
> windows.h.
But you've used the W-word... :D
I'm for keeping it alphabetical too, I just didn't want to be that
pedantic.
I haven't ever seen an issue with the order of headers, but that
doesn't say much, I haven't seen much of a variety of systems. I'd
think it would be an issue with the headers themselves and wouldn't
expect that on modern systems though.
> > Acked-by: Christophe Fergeau <cfergeau at redhat.com>
> >
> > Christophe
> >
>
> Frediano
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
More information about the Spice-devel
mailing list