delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/03/05/14:01:39

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 525J1d6H052504
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 525J1d6H052504
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=SzvfskU2
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 73B823858C98
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1741201296;
bh=1cQu61QQOSlGYKUhIPBFTnJNxqrUTSEgjbxT0HN6XGk=;
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=SzvfskU28SHmmA5Tnq+uOGRuUjPIUMpsCFrf2A8qhKQMP+c8WavU2dCnpv3390SrW
AKIFNC5xtq+tIqjmoV609mfWQGd4J1vWQv84zyF8TVS1ks1DtNRhjSg0k/AQnxnxew
4M2uZ8fbU0YhVgBNTsJwHPtOrARQGk7D3PCL2Rtg=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2B853858D34
Date: Wed, 5 Mar 2025 19:58:45 +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: <Z8ie5ezqgXKtnmnl@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CAKAoaQkjCNVRr3wj_2S=FW+-0YLs6SpxN1Fecws83NRR9E0Q3A AT mail DOT gmail DOT com>
<112c2ecc-cfc6-86d4-d7b6-bce46d92197e AT t-online DOT de>
MIME-Version: 1.0
In-Reply-To: <112c2ecc-cfc6-86d4-d7b6-bce46d92197e@t-online.de>
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

On Mar  5 17:16, Christian Franke via Cygwin wrote:
> Roland Mainz via Cygwin wrote:
> > Small issue with Cygwin 3.6 (3.6.0-0.419.g3c1308ed890e.x86_64) system
> > /usr/include/unistd.h and clang:
> > ---- snip ----
> > $ clang --version
> > clang version 8.0.1 (tags/RELEASE_801/final)
> > Target: x86_64-unknown-windows-cygnus
> > Thread model: posix
> > InstalledDir: /usr/bin
> > $ clang -std=gnu17 -Wall -Wextra -g foo.c -lntdll -o foo.i686.exe
> > In file included from foo.c:37:
> > In file included from /usr/include/unistd.h:4:
> > /usr/include/sys/unistd.h:218:42: error: parameter name omitted
> > static inline void setproctitle_init (int, char *[], char *[]) {}
> 
> The error is valid because the addition of this very old C++ feature took a
> very long time :-)
> 
> clang 15 says:
> warning: omitting the parameter name in a function definition is a C2x
> extension [-Wc2x-extensions]
> 
> gcc 12 requires '-pedantic' option:
> warning: ISO C does not support omitting parameter names in function
> definitions before C2X [-Wpedantic]

Weird, I can't reproduce this, neither with gcc 12 nor with gcc 15.

  $ cat <<EOF >x.c
  #define _BSD_SOURCE
  #include <unistd.h>

  int
  main (int argc, char **argv, char **envp)
  {
    setproctitle_init (argc, argv, envp);
  }
  EOF
  $ gcc -g -O2 -Wall -pedantic -std=c99 x.c -o x
  $ 

No warning.  What am I missing?

We should still fix it.  We could change this to a macro instead:

-static inline void setproctitle_init (int, char *[], char *[]) {}
+#define setproctitle_init(c, a, e)

Would that help?


Corinna

-- 
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019