Repository: conan-io/conan-center-index

Issue:
[package] avahi/0.8: Fails to build with Clang 16 on Linux
### Description

Building with Clang 16.0.1 on Linux fails due to the `setproctitle` function not being declared.

### Package and Environment Details

* Package Name/Version: **avahi/0.8**
* Operating System+version: **Fedora Linux 38**
* Compiler+version: **Clang 16.0.1**
* Conan version: **conan 1.59.0**
* Python version: **Python 3.11.3**


### Conan profile

[settings]
os=Linux
arch=x86_64
compiler=clang
compiler.version=16
compiler.libcxx=libc++
compiler.cppstd=17
build_type=Debug
[options]
[conf]
tools.build:compiler_executables={'asm': 'clang', 'c': 'clang', 'cpp': 'clang++'}
tools.cmake.cmaketoolchain:user_toolchain=['/var/home/jordan/.conan/toolchains/clang.cmake']
[build_requires]
[env]
CONAN_CMAKE_TOOLCHAIN_FILE=['"/var/home/jordan/.conan/toolchains/clang.cmake"']
CC=clang
CXX=clang++

### Steps to reproduce

```
conan install avahi/0.8@ --remote conancenter --build cascade  --build outdated \
  --install-folder build/x86_64-clang/Debug \
  --profile:build linux/clang/release \
  --profile:host linux/clang/debug \
  --update
```

### Logs

<details><summary>Click to expand log</summary>

```
  CC       avahi_daemon-dbus-async-host-name-resolver.o
/var/home/jordan/.conan/data/avahi/0.8/_/_/build/e763d958b752539851f432d62c73bd4d2147df25/src/avahi-daemon/setproctitle.c:48:32: warning: unused parameter 'argc' [-Wunused-parameter]
void avahi_init_proc_title(int argc, char **argv) {
                               ^
/var/home/jordan/.conan/data/avahi/0.8/_/_/build/e763d958b752539851f432d62c73bd4d2147df25/src/avahi-daemon/setproctitle.c:48:45: warning: unused parameter 'argv' [-Wunused-parameter]
void avahi_init_proc_title(int argc, char **argv) {
                                            ^
In file included from /var/home/jordan/.conan/data/avahi/0.8/_/_/build/e763d958b752539851f432d62c73bd4d2147df25/src/avahi-daemon/static-services.c:45:
/var/home/jordan/.conan/data/avahi/0.8/_/_/build/e763d958b752539851f432d62c73bd4d2147df25/src/avahi-common/domain.h:36:16: warning: invalid UTF-8 in comment [-Winvalid-utf8]
/var/home/jordan/.conan/data/avahi/0.8/_/_/build/e763d958b752539851f432d62c73bd4d2147df25/src/avahi-daemon/setproctitle.c: * four labels <E1> 63 characters plus three inner dots. Escaping the
87:               ^
5: error: call to undeclared function 'setproctitle'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    setproctitle("-%s", t);
    ^
2 warnings and 1 error generated.
make[2]: *** [Makefile:926: avahi_daemon-setproctitle.o] Error 1
make[2]: *** Waiting for unfinished jobs....
  CC       avahi_daemon-dbus-async-service-resolver.o
In file included from /var/home/jordan/.conan/data/avahi/0.8/_/_/build/e763d958b752539851f432d62c73bd4d2147df25/src/avahi-daemon/main.c:65:
/var/home/jordan/.conan/data/avahi/0.8/_/_/build/e763d958b752539851f432d62c73bd4d2147df25/src/avahi-common/domain.h:36:16: warning: invalid UTF-8 in comment [-Winvalid-utf8]
 * four labels <E1> 63 characters plus three inner dots. Escaping the
               ^
In file included from /var/home/jordan/.conan/data/avahi/0.8/_/_/build/e763d958b752539851f432d62c73bd4d2147df25/src/avahi-daemon/dbus-protocol.c:47:
/var/home/jordan/.conan/data/avahi/0.8/_/_/build/e763d958b752539851f432d62c73bd4d2147df25/src/avahi-common/domain.h:36:16: warning: invalid UTF-8 in comment [-Winvalid-utf8]
 * four labels <E1> 63 characters plus three inner dots. Escaping the
               ^
1 warning generated.
1 warning generated.
1 warning generated.
make[2]: Leaving directory '/var/home/jordan/.conan/data/avahi/0.8/_/_/build/e763d958b752539851f432d62c73bd4d2147df25/build-debug/avahi-daemon'
make[1]: *** [Makefile:825: all-recursive] Error 1
make[1]: Leaving directory '/var/home/jordan/.conan/data/avahi/0.8/_/_/build/e763d958b752539851f432d62c73bd4d2147df25/build-debug'
make: *** [Makefile:735: all] Error 2
avahi/0.8:
avahi/0.8: ERROR: Package 'e763d958b752539851f432d62c73bd4d2147df25' build failed
avahi/0.8: WARN: Build folder /var/home/jordan/.conan/data/avahi/0.8/_/_/build/e763d958b752539851f432d62c73bd4d2147df25/build-debug
ERROR: avahi/0.8: Error in build() method, line 84
	autotools.make()
	ConanException: Error 2 while executing make -j12
```

</details>



Discussion:

Resolving patch:
diff --git a/recipes/avahi/all/conanfile.py b/recipes/avahi/all/conanfile.py
--- a/recipes/avahi/all/conanfile.py
+++ b/recipes/avahi/all/conanfile.py
@@ -70,6 +70,8 @@ def generate(self):
         tc.configure_args.append("--disable-python")
         tc.configure_args.append("--disable-qt5")
         tc.configure_args.append("--with-systemdsystemunitdir=/lib/systemd/system")
+        if self.settings.os == "Linux":
+            tc.configure_args.append("ac_cv_func_setproctitle=no")
         tc.generate()
         AutotoolsDeps(self).generate()
         PkgConfigDeps(self).generate()


Test patch: