Skip to content

Commit d97d2c9

Browse files
committed
Fixed wrong number of arguments specified for 'deprecated' attribute
The was an issue with the GCC `__attribute__((deprecated))` syntax in the macro definition of `XML_DEPRECATED`. The problem was that older GCC versions don't accept a string message argument in the deprecated attribute. See https://gcc.gnu.org/gcc-4.5/changes.html Cherry-pick with minor modifications. Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech> (cherry picked from commit 4713578)
1 parent 66fc4e8 commit d97d2c9

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

deps-packaging/libxml2/cfbuild-libxml2.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ fi
3434
LD_LIBRARY_PATH="%{prefix}/lib" LD_RUN_PATH="%{prefix}/lib"
3535

3636
%build
37+
38+
patch -p1 < %{_topdir}/SOURCES/no-arg-in-deprecated.patch
3739
make
3840

3941
%install

deps-packaging/libxml2/hpux/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CPPFLAGS="-I${PREFIX}/include"
1515
mv configure configure.bak
1616
sed 's/ *-Wno-array-bounds//' configure.bak >configure
1717
chmod a+x configure
18+
$PATCH -p1 < no-arg-in-deprecated.patch
1819
./configure CPPFLAGS="$CPPFLAGS" --prefix=${PREFIX} --without-python --without-iconv --without-lzma --without-zlib --with-iso8859x
1920

2021
# Build
@@ -38,4 +39,3 @@ rm -rf ${LXD}/share
3839

3940
mkdir -p ${LX}/lib
4041
mv ${LXD}/lib/*.so* ${LX}/lib
41-
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff -ruN libxml2-2.15.0/include/libxml/xmlexports.h libxml2-2.15.0-modified/include/libxml/xmlexports.h
2+
--- libxml2-2.15.0/include/libxml/xmlexports.h 2025-09-15 13:55:59.000000000 +0200
3+
+++ libxml2-2.15.0-modified/include/libxml/xmlexports.h 2025-09-25 10:52:38.346569829 +0200
4+
@@ -55,8 +55,12 @@
5+
#ifndef XML_DEPRECATED
6+
#if defined(IN_LIBXML)
7+
#define XML_DEPRECATED
8+
- #elif __GNUC__ * 100 + __GNUC_MINOR__ >= 301
9+
+ #elif __GNUC__ * 100 + __GNUC_MINOR__ >= 405
10+
+ /* GCC 4.5+ supports deprecated with message */
11+
#define XML_DEPRECATED __attribute__((deprecated("See https://gnome.pages.gitlab.gnome.org/libxml2/html/deprecated.html")))
12+
+ #elif __GNUC__ * 100 + __GNUC_MINOR__ >= 301
13+
+ /* GCC 3.1+ supports deprecated without message */
14+
+ #define XML_DEPRECATED __attribute__((deprecated))
15+
#elif defined(_MSC_VER) && _MSC_VER >= 1400
16+
/* Available since Visual Studio 2005 */
17+
#define XML_DEPRECATED __declspec(deprecated("See https://gnome.pages.gitlab.gnome.org/libxml2/html/deprecated.html"))

0 commit comments

Comments
 (0)