Opened 4 years ago

Closed 4 years ago

#61362 closed defect (fixed)

sane-backends @1.0.28: error: implicit declaration of function 'basename' is invalid in C99

Reported by: dafydd2277 (David Barr) Owned by: macosx12345 <someuser12@…>
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc: someuser12, 31n81t (Maigurs), JacquesLB, nomennudum (Roger Hayter), amake (Aaron Madlon-Kay)
Port: sane-backends

Description

I'll attach the complete build log file ASAP. Important lines here:

:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_sane-backends/sane-backends/work/sane-backends-1.0.28/backend'
:info:build Making all in frontend
:info:build make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_sane-backends/sane-backends/work/sane-backends-1.0.28/frontend'
:info:build depbase=`echo scanimage.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
:info:build 	/usr/bin/clang -DHAVE_CONFIG_H -I. -I../include/sane  -DPATH_SANE_CONFIG_DIR=/opt/local/etc/sane.d 	  -DPATH_SANE_DATA_DIR=/opt/local/share 	  -DPATH_SANE_LOCK_DIR=/opt/local/var/lock/sane 	  -DV_MAJOR=1 -DV_MINOR=0 -I. -I. -I../include -I../include -I/opt/local/include -fno-common -include sys/types.h -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -MT scanimage.o -MD -MP -MF $depbase.Tpo -c -o scanimage.o scanimage.c &&\
:info:build 	mv -f $depbase.Tpo $depbase.Po
:info:build scanimage.c:1229:42: error: implicit declaration of function 'basename' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
:info:build               png_set_iCCP(*png_ptr, *info_ptr, basename(icc_profile), PNG_COMPRESSION_TYPE_BASE, icc_buffer, icc_size);
:info:build                                                 ^
:info:build scanimage.c:1229:42: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'png_const_charp' (aka 'const char *') [-Wint-conversion]
:info:build               png_set_iCCP(*png_ptr, *info_ptr, basename(icc_profile), PNG_COMPRESSION_TYPE_BASE, icc_buffer, icc_size);
:info:build                                                 ^~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/include/png.h:2097:42: note: passing argument to parameter 'name' here
:info:build     png_inforp info_ptr, png_const_charp name, int compression_type,
:info:build                                          ^
:info:build 1 warning and 1 error generated.
:info:build make[1]: *** [scanimage.o] Error 1
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_sane-backends/sane-backends/work/sane-backends-1.0.28/frontend'
:info:build make: *** [all-recursive] Error 1
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_sane-backends/sane-backends/work/sane-backends-1.0.28'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_sane-backends/sane-backends/work/sane-backends-1.0.28" && /usr/bin/make -w all 
:info:build Exit code: 2
:error:build Failed to build sane-backends: command execution failed

No maintainer information:

$ sudo port info sane-backends
sane-backends @1.0.28 (graphics)
Variants:             [+]avahi, disable_localbackends, enable_pnmbackend, universal, with_gphoto2

Description:          These are the backends for the Scanner Access Now Easy project. They allow you to access various
                      scanners either locally or remotely using saned.
Homepage:             http://www.sane-project.org/

Build Dependencies:   pkgconfig
Library Dependencies: jpeg, libusb, net-snmp, tiff, zlib, openssl, avahi
Platforms:            darwin
License:              GPL-2+
Maintainers:          none

Attachments (1)

main.log.gz (38.3 KB) - added by dafydd2277 (David Barr) 4 years ago.
Complete build log file. 600kb expanded.

Download all attachments as: .zip

Change History (15)

Changed 4 years ago by dafydd2277 (David Barr)

Attachment: main.log.gz added

Complete build log file. 600kb expanded.

comment:1 Changed 4 years ago by dafydd2277 (David Barr)

http://www.sane-project.org/ reports sane-backends 1.0.31 released the end of August. I'm willing to try building that if I can get help with download and commands.

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

We are seeing "implicit declaration of function" errors with many different ports ever since the release of Xcode 12. In previous versions of Xcode, this condition was only a warning. Now that it has been upgraded to an error, we need to work on fixing it, so thank you for reporting it.

I'll try updating the port to 1.0.31 and if that doesn't fix it I'll try to add a patch.

If you want to avoid these kinds of problems, downgrade to Xcode 11 and the Xcode 11 version of the command line tools, both available from Apple Developer Downloads.

comment:3 Changed 4 years ago by dafydd2277 (David Barr)

Installing against XCode 11 worked, but I'll call that a workaround. If you want someone to test against XCode 12, I'm willing to be a tester/verifier.

comment:4 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Yes, using Xcode 11 is a workaround that you can use until the problem is fixed.

comment:6 Changed 4 years ago by someuser12

Cc: someuser12 added

comment:7 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: 31n81t added
Summary: sane-backends 1.0.28+avahi.darwin_19 - scanimage.c compile error.sane-backends @1.0.28: error: implicit declaration of function 'basename' is invalid in C99

Has duplicate #61412.

comment:8 Changed 4 years ago by JacquesLB

The same problem occurred in virtuoso-7. It has been fixed by allowing implicit functions declarations. See:

https://github.com/macports/macports-ports/pull/9098/files/3cb5af4a818735009921bbe80df923e686f48bed

Could the same patch be applied here?

Jacques

comment:9 Changed 4 years ago by JacquesLB

Cc: JacquesLB added

comment:10 Changed 4 years ago by nomennudum (Roger Hayter)

Cc: nomennudum added

comment:11 Changed 4 years ago by JacquesLB

Anything new?

JLB

comment:12 Changed 4 years ago by amake (Aaron Madlon-Kay)

Cc: amake added

comment:13 Changed 4 years ago by amake (Aaron Madlon-Kay)

I've pushed an update to https://github.com/macports/macports-ports/pull/8934 that hopefully addresses the remaining issues.

comment:14 Changed 4 years ago by macosx12345 <someuser12@…>

Owner: set to macosx12345 <someuser12@…>
Resolution: fixed
Status: newclosed

In f34c734adeca684b943b72e711a91c2f70235758/macports-ports (master):

sane-backends: update to 1.0.31 and fix build error (https://github.com/macports/macports-ports/pull/8934)

  • sane-backends: update to 1.0.31 and fix build error

Fixes #61362

  • Fixed implicit function declaration when detecting IPv6 support
  • Deleted disused patch
  • libxml2 is linked opportunistically and disabling caused problems in my

testing

  • --{en,dis}able-avahi renamed to --with{,out}-avahi
  • --without-api-spec has been removed
  • libcurl and poppler may be opportunistically linked for eslc support
  • Renamed variants to be less verbose
  • Added eslc variant

Co-authored-by: Aaron Madlon-Kay <amake@…>

Note: See TracTickets for help on using tickets.