A user reported that GCC 5.x was using the atomic fallback for GCC 4.x because the test #elif __GNUC__ >= 4 && __GNUC_MINOR__ >= 7 didn't include GCC 5. However, GCC 5+ has <stdatomic.h> and shouldn't use any of the GCC-specific cases at all. I think that this user was actually pulling our atomics out into third-party code that probably didn't define HAVE_STDATOMIC_H properly, so this commit both avoids that problem for them in the future and clarifies the intent of the ovs-atomic header.
Signed-off-by: Ben Pfaff <b...@ovn.org> --- lib/ovs-atomic.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ovs-atomic.h b/lib/ovs-atomic.h index c8e616cb4c37..f1f2c384f1cd 100644 --- a/lib/ovs-atomic.h +++ b/lib/ovs-atomic.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014 Nicira, Inc. + * Copyright (c) 2013, 2014, 2017 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -325,6 +325,8 @@ #include "ovs-atomic-clang.h" #elif HAVE_STDATOMIC_H #include "ovs-atomic-c11.h" + #elif __GNUC__ >= 5 + #error "GCC 5+ should have <stdatomic.h>" #elif __GNUC__ >= 4 && __GNUC_MINOR__ >= 7 #include "ovs-atomic-gcc4.7+.h" #elif __GNUC__ && defined(__x86_64__) -- 2.10.2 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev