From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id DDEB42256B for ; Tue, 16 Apr 2024 05:57:19 +0200 (CEST) Received: (qmail 21740 invoked by uid 550); 16 Apr 2024 03:57:12 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 21695 invoked from network); 16 Apr 2024 03:57:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mforney.org; s=google; t=1713239824; x=1713844624; darn=lists.openwall.com; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:message-id:from:subject:cc:to:date:from:to:cc:subject :date:message-id:reply-to; bh=O8zF4ppujfC19sRvi9qgs/r92CL14W4vINC3p9672Xc=; b=ApGxCNs4OQjsE4+IVmZZmQf23iDoVlJP7MzRvPnMJNCSpvVFf0wFr+HfOuYFaGzTGB lJWhd3ClfMDZh608k7gWvUeVPTIrzDhQ0eSNJ5p/ere/Q08JAsceeaZCNSFy5+6AYSBN L+ZSF3TJCap5TVE1/EIZMll72lLvHxDW9wkL5z1SaPg0IELbtspYm1SNZQBg+Emk46Br 7gzDBk1H7RiE9lxbA5FXoWA81BBgvIP0ulYR+nuNEmYk5+k4jAm+F9LUp/xokNh54JuT B//M7+mL3siN0l7fCMUtTu7iyYSeo48qNBeeTuavziLW72mNctkdLu3Kc78wOfRyTX2o 91YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713239824; x=1713844624; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:message-id:from:subject:cc:to:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=O8zF4ppujfC19sRvi9qgs/r92CL14W4vINC3p9672Xc=; b=pVTi4Ww6DSx/tw7QUykdAC2ZDyjTPNpajRjrbqPHV2xZjEYzWyG4JN/9TwTAAl/LOw TGkQAwlQvgyclkvALa1mlgkq4ABOJGeosH3LmSKcUw/Bm6LgFaYNscZInI6pUEHal1RX J+64KO6Hk5y43OJ68pFZvBlcNR3B2m9fIqfuboay//WOWOzN0KuF/Yk+P8A3TV3XSLwr ZeLAcsc1F4j/BDCKkBmD3A15Yu/zwJgWida/N784/REjYapT6f22mXVYzFm2j+OhLrKg ZMOY0dHUHyBPx/vUTPc4hVyQ9yz8oHReN48QF/muYdbkjKFrI33RvnfNMWhIcoGqb4Ev aViQ== X-Gm-Message-State: AOJu0YwFyqNrkh557TAKEsV3llq/0nWJ3fc7ElsRjbuXr5m/ch4gR73l sVedXUYr6qlhHxYSTOSn/9dzaBx8V51yvBsltHFp+0XJnVfU9Aj4GLM4ohRmkZw= X-Google-Smtp-Source: AGHT+IHIuMVYTT0xtxvzTXs3Y74I54IghkG16+5bfwygPux+dTd2VEnFkbU+/sIUHkz0KSBRir7nbA== X-Received: by 2002:a05:6a00:2d88:b0:6ed:21b2:cb17 with SMTP id fb8-20020a056a002d8800b006ed21b2cb17mr12038420pfb.4.1713239823748; Mon, 15 Apr 2024 20:57:03 -0700 (PDT) Date: Mon, 15 Apr 2024 20:57:35 -0700 To: Jens Gustedt Cc: musl@lists.openwall.com From: Michael Forney Message-Id: <29L5XTRHVUHVF.2NI3H53T4EFFS@mforney.org> In-Reply-To: <20240319151202.6856ebec@inria.fr> References: <20240319151202.6856ebec@inria.fr> User-Agent: mblaze/1.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [musl] Re: [PATCH] C23: update some legacy function pointers Jens Gustedt wrote: > In C23, empty parameter lists loose their meaning as "function that > may receive any number of parameters". >=20 > When compiling with -std=3Dc2x, there were three left-overs in musl that > still used that. Change them to use the correct prototype, since it is > available at all these places, anyhow. I think there's one more: diff --git a/src/process/posix_spawn.c b/src/process/posix_spawn.c index 8294598b..e05f1623 100644 --- a/src/process/posix_spawn.c +++ b/src/process/posix_spawn.c @@ -149,7 +149,7 @@ static int child(void *args_vp) ? &attr->__mask : &args->oldmask, 0); =20 int (*exec)(const char *, char *const *, char *const *) =3D - attr->__fn ? (int (*)())attr->__fn : execve; + attr->__fn ? (int (*)(const char *, char *const *, char *const *))attr->= __fn : execve; =20 exec(args->path, args->argv, args->envp); ret =3D -errno; Perhaps it's better to solve this by changing the type of __fn in posix_spawnattr_t from void * to the appropriate function type, but since this is in a public header, I'm not sure if it somehow breaks something: diff --git a/include/spawn.h b/include/spawn.h index 8eb73e00..fec1280d 100644 --- a/include/spawn.h +++ b/include/spawn.h @@ -29,7 +29,7 @@ typedef struct { pid_t __pgrp; sigset_t __def, __mask; int __prio, __pol; - void *__fn; + int (*__fn)(const char *, char *const *, char *const *); char __pad[64-sizeof(void *)]; } posix_spawnattr_t; =20 diff --git a/src/process/posix_spawn.c b/src/process/posix_spawn.c index 8294598b..2611fb94 100644 --- a/src/process/posix_spawn.c +++ b/src/process/posix_spawn.c @@ -149,7 +149,7 @@ static int child(void *args_vp) ? &attr->__mask : &args->oldmask, 0); =20 int (*exec)(const char *, char *const *, char *const *) =3D - attr->__fn ? (int (*)())attr->__fn : execve; + attr->__fn ? attr->__fn : execve; =20 exec(args->path, args->argv, args->envp); ret =3D -errno; diff --git a/src/process/posix_spawnp.c b/src/process/posix_spawnp.c index aad6133b..28ef1aa4 100644 --- a/src/process/posix_spawnp.c +++ b/src/process/posix_spawnp.c @@ -8,6 +8,6 @@ int posix_spawnp(pid_t *restrict res, const char *restrict = file, { posix_spawnattr_t spawnp_attr =3D { 0 }; if (attr) spawnp_attr =3D *attr; - spawnp_attr.__fn =3D (void *)__execvpe;=09 + spawnp_attr.__fn =3D __execvpe;=09 return posix_spawn(res, file, fa, &spawnp_attr, argv, envp); }