Skip to content

Commit 8a52b02

Browse files
committed
Fixed implicit declaration of fopen()
After upgrading to curl 8.16.0 we got ``` altsvc.c: In function 'altsvc_load': altsvc.c:230:8: error: implicit declaration of function 'fopen' [-Werror=implicit-function-declaration] fp = fopen(file, FOPEN_READTEXT); ^~~~~ ``` on AIX 7.1. The header stdio.h is probably included indirectly on all other platforms. Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent 52b33e4 commit 8a52b02

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

deps-packaging/libcurl/cfbuild-libcurl.spec

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ mkdir -p %{_builddir}
4646

4747
%build
4848

49+
# Implicit declaration of function 'fopen' after upgrading to curl 8.16.0.
50+
# This is only needed for AIX 7.1.
51+
# However, it does not hurt to apply it for every one.
52+
patch -p1 < %{_topdir}/SOURCES/implicit-decl-fopen.patch
53+
4954
make
5055

5156
%install
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -ruN curl-8.16.0/lib/altsvc.c curl-8.16.0-modified/lib/altsvc.c
2+
--- curl-8.16.0/lib/altsvc.c 2025-09-10 07:43:43.000000000 +0200
3+
+++ curl-8.16.0-modified/lib/altsvc.c 2025-09-23 12:31:02.073633250 +0200
4+
@@ -27,6 +27,8 @@
5+
*/
6+
#include "curl_setup.h"
7+
8+
+#include <stdio.h> /* fopen() */
9+
+
10+
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_ALTSVC)
11+
#include <curl/curl.h>
12+
#include "urldata.h"

0 commit comments

Comments
 (0)