sparse fails to process OpenSSL configuration header file in recent
OpenSSL version (3.2.x). Add workaround header that will disable
the problematic macro.

Signed-off-by: Ales Musil <amu...@redhat.com>
---
 include/sparse/automake.mk             |  1 +
 include/sparse/openssl/configuration.h | 30 ++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 include/sparse/openssl/configuration.h

diff --git a/include/sparse/automake.mk b/include/sparse/automake.mk
index 052a1b4b8..6584b5617 100644
--- a/include/sparse/automake.mk
+++ b/include/sparse/automake.mk
@@ -11,6 +11,7 @@ noinst_HEADERS += \
         include/sparse/netinet/in.h \
         include/sparse/netinet/ip6.h \
         include/sparse/netpacket/packet.h \
+        include/sparse/openssl/configuration.h \
         include/sparse/pthread.h \
         include/sparse/rte_memcpy.h \
         include/sparse/sys/socket.h \
diff --git a/include/sparse/openssl/configuration.h 
b/include/sparse/openssl/configuration.h
new file mode 100644
index 000000000..b5fe3efc2
--- /dev/null
+++ b/include/sparse/openssl/configuration.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2025, Red Hat, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CHECKER__
+#error "Use this header only with sparse.  It is not a correct implementation."
+#endif
+
+#ifndef __OPENSSL_CONFIGURATION_SPARSE
+#define __OPENSSL_CONFIGURATION_SPARSE
+
+#ifndef __has_include
+#define __has_include(X) 0
+#endif
+
+#include_next <openssl/configuration.h>
+
+#endif /* <openssl/configuration.h> sparse */
-- 
2.49.0

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to