From nobody Fri Jan 6 18:04:59 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NpWT76TNxz2p5mc; Fri, 6 Jan 2023 18:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NpWT75j7tz3Jmp; Fri, 6 Jan 2023 18:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673028299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N/fMcW5qHzvYRQ4S1qNeb+e806zPAMv9iXl1UP8Wvnc=; b=iONtsITL5VlQWbMtfWhpP6rURcQa+eHT0kHEjp8RzGc02uOnAnN+a8GXRq3yZAXbQEScx/ RVi+A01jbiG+q73m+3nQ0+nBrKEIhOw6OTyIyzTN69cHqHXWcHDrlAx2iTfFQ84UjQxLan 3d6ppW/nqu36HjkdlneIlVlYjKHrMGnUgLXImQmb2VRujXDtHTc18d0MoUJPqE1ZiXp2ZX AI3m9H1ObhPKbBc4nO5iA/2F05QeOv1h9Uz+pq1r0yuK6YgLKu8jNh6qZf7xwTtZE+RKCt sVPjvieH1GJ/Qa4rpQYr8/Y2utLlW1XLaTu0uPNexlG03MKzySZs1pQ3eQDn0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673028299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N/fMcW5qHzvYRQ4S1qNeb+e806zPAMv9iXl1UP8Wvnc=; b=lqyrlL6rbgelJ24mCzJsfGWiZ8f4NoTJAQkuyvROHpKeq76U0NT2dJVvMdtooL9BCJUUW0 G3T87DCBovo21txOxfg9PHG94bQFKES25UVWoZ1bOCSvy03QquDNo7FKXReO/BOctuBRwj 4gwyikcvn2F19cTHwpt+2sMRD+M8i7KKa17SZJNzsySZFlLMcQLrQROzJiDMHuJvcnTXYq zne1w9UWbUosLtzfHxHTv/rK4l+uiy+AyPDdxzmo4CRme+uoUlqV4/sUxwEfsUP/izPG3M 672s0lFqrQNc0BExZqnJWZdcgBgz/TnekjBN1tCLqDjmCyJSg25pxRVdiaymKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673028299; a=rsa-sha256; cv=none; b=RlYY7d5srA4mfHPGAxt2VTy+3sFcpksndKdGudZf2Lb/VUO94/5M0cfQxwepahP6DwnIsu kxyvEVWzzxcx2DDgBZD0pG+ZdMdIHFisQHMzhIqDs3MNNmD8p/N3GesSdvemHmaL0F0poW AvxmnnspngNRXiVn+EhLHdA6w4lKQ4UYNmaBKBRZ3ZPb7mox5x3rf4lIE75NdJkiG3cuBH Zp60EQEEKnV0/2AIVTc8wB0dT6bXMDUdpU4gc393sEv5Rh5umU45dbizim78ZdyaSqzywZ f2TizEUwiDS3a+Fk5jDixmDtfrjZq9w+BbbPslWwQeEtVbglV0yG/g2c5Ju0Uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NpWT74ll3zfj2; Fri, 6 Jan 2023 18:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 306I4xXu009830; Fri, 6 Jan 2023 18:04:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 306I4xjs009829; Fri, 6 Jan 2023 18:04:59 GMT (envelope-from git) Date: Fri, 6 Jan 2023 18:04:59 GMT Message-Id: <202301061804.306I4xjs009829@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dimitry Andric Subject: git: 9fbb5958d12c - main - graphics/sane-backends: fix build with clang 15 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9fbb5958d12c843b3ae52c74a6ecfe5a76623302 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim (src committer): URL: https://cgit.FreeBSD.org/ports/commit/?id=9fbb5958d12c843b3ae52c74a6ecfe5a76623302 commit 9fbb5958d12c843b3ae52c74a6ecfe5a76623302 Author: Dimitry Andric AuthorDate: 2023-01-05 17:04:52 +0000 Commit: Dimitry Andric CommitDate: 2023-01-06 18:03:41 +0000 graphics/sane-backends: fix build with clang 15 During an exp-run for llvm 15 (see bug 265425), it turned out that graphics/sane-backends failed to build with clang 15: jpegtopdf.c:204:5: error: incompatible pointer to integer conversion assigning to 'long' from 'char *(int, int)' [-Wint-conversion] tz = timezone; ^ ~~~~~~~~ scanimage.c:1248:42: warning: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] png_set_iCCP(*png_ptr, *info_ptr, basename(icc_profile), PNG_COMPRESSION_TYPE_BASE, icc_buffer, icc_size); ^ scanimage.c:1248:42: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'png_const_charp' (aka 'const char *') [-Wint-conversion] png_set_iCCP(*png_ptr, *info_ptr, basename(icc_profile), PNG_COMPRESSION_TYPE_BASE, icc_buffer, icc_size); ^~~~~~~~~~~~~~~~~~~~~ The jpegtopdf error is because 'timezone' as a global external variable does not exist on FreeBSD: it is a glibc-ism. Use struct tm's tm_gmtoff field instead, which also has its sign reversed from the glibc global. The scanimage error is because basename(3) is used without including . With glibc, basename() is declared in both string.h and libgen.h, where the former gives you the GNU specific variant, and the latter the POSIX variant. PR: 268771 Approved by: vvd@unislabs.com (maintainer) MFH: 2023Q1 --- graphics/sane-backends/files/patch-frontend_jpegtopdf.c | 14 ++++++++++++++ graphics/sane-backends/files/patch-frontend_scanimage.c | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/graphics/sane-backends/files/patch-frontend_jpegtopdf.c b/graphics/sane-backends/files/patch-frontend_jpegtopdf.c new file mode 100644 index 000000000000..f6e4be53ca79 --- /dev/null +++ b/graphics/sane-backends/files/patch-frontend_jpegtopdf.c @@ -0,0 +1,14 @@ +--- frontend/jpegtopdf.c.orig 2022-01-19 16:38:00 UTC ++++ frontend/jpegtopdf.c +@@ -201,7 +201,11 @@ static SANE_Int _get_current_time( struct tm *pt, SANE + goto EXIT; + } + /* get time difference ( OHH'mm' ) */ ++#ifdef __FreeBSD__ ++ tz = -pt->tm_gmtoff; ++#else + tz = timezone; ++#endif + if ( tz > 0 ) { + *sign_c = '-'; + } diff --git a/graphics/sane-backends/files/patch-frontend_scanimage.c b/graphics/sane-backends/files/patch-frontend_scanimage.c new file mode 100644 index 000000000000..cd7a92a0be01 --- /dev/null +++ b/graphics/sane-backends/files/patch-frontend_scanimage.c @@ -0,0 +1,12 @@ +--- frontend/scanimage.c.orig 2022-01-19 16:38:00 UTC ++++ frontend/scanimage.c +@@ -39,6 +39,9 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#endif + + #include + #include