DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 5268sQsH339965 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 5268sQsH339965 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=CjDXU4+C X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 891DE385841C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1741251264; bh=u70vnlORd3T3F5o+7iCC9VLAPhlvhiNAEHkJAOyLLmI=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=CjDXU4+CNE8+Iaxbez3aYBtvHpXVeNq1AtMwdiA3xtzI8qodem4+0Zt//LPDr/Bfe w3cQnWyOeNJMGwgGtYi9meOQl5bhh49O8nQBmMEDI7Sd67gLaAV1h4e0drrUshQTl5 FUyERNtxA0n1L0UjnV5FVEG19zZ19Qh/ae7lTxfo= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0ECF33858C2C Date: Thu, 6 Mar 2025 09:52:01 +0100 To: cygwin AT cygwin DOT com Subject: Re: Cygwin 3.6: clang cannot use /usr/include/unistd.h, issue with |setproctitle_init()| ... Message-ID: Mail-Followup-To: cygwin AT cygwin DOT com References: <112c2ecc-cfc6-86d4-d7b6-bce46d92197e AT t-online DOT de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Corinna Vinschen via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Corinna Vinschen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Guys, I already applied a patch. Thanks, Corinna On Mar 5 15:51, Glenn Strauss via Cygwin wrote: > On Wed, Mar 05, 2025 at 08:27:53PM +0000, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin wrote: > > > We could change this to a macro instead: > > > > > > -static inline void setproctitle_init (int, char *[], char *[]) {} > > > +#define setproctitle_init(c, a, e) > > > > Changing to the empty marco removes the side effects in the arguments (such as len++, for example), > > which may silently break existing code -- so I think it's not a good idea. If the idea to use the empty > > arguments was not to implicitly document them (because the API was slated for removal, IIRC), then > > naming them just with "arg1", "arg2" (rather than leaving empty altogether) should help better, IMO. > > > > Anton Lavrentiev > > Contractor NIH/NLM/NCBI > > If you want the side effects of the arguments and still want a macro: > > #define setproctitle_init(c, a, e) \ > do { (void)(c); (void)(a); (void)(e); } while (0) > > or, since it is unlikely (though possible) that someone has defined a > single-letter macro for 'c', 'a', or 'b': > > static inline void setproctitle_init (int c, char *a[], char *b[]) > { > (void)(c); > (void)(a); > (void)(e); > } > > or use the intended, more descriptive names in the prototype > > static inline void setproctitle_init (int argc, char *argv[], char *envp[]) > { > (void)(argc); > (void)(argv); > (void)(envp); > } > > If gcc or clang, you could also add __attribute__((__unused__)), > though it should probaby be its own macro so that it could be no-op for > certain compilers: > > There is also [[maybe_unused]] > https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused > https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4189?view=msvc-170 > > #ifndef __attribute_unused__ > #ifdef _MSC_VER > #define __attribute_unused__ [[maybe_unused]] > #else > #define __attribute_unused__ __attribute__((__unused__)), > #endif > #endif > > static inline void setproctitle_init (int argc __attribute_unused__, > char *argv[] __attribute_unused__, > char *envp[] __attribute_unused__) > { > (void)(argc); > (void)(argv); > (void)(envp); > } > > Cheers, Glenn > > -- > Problem reports: https://cygwin.com/problems.html > FAQ: https://cygwin.com/faq/ > Documentation: https://cygwin.com/docs.html > Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple