DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 525JBVGx056763
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 525JBVGx056763
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=dJKHUZY0
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8D653858C98
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1741201890;
	bh=UamQPvzkfqGQ5eOGTx8gbEu7rTUhHl0n4SwmIB7xzdI=;
	h=Subject:In-Reply-To:Date:Cc:References:To:List-Id:
	 List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
	 From:Reply-To:From;
	b=dJKHUZY0kXipCFk5H1hcgPDjQAKbDNsTkV/IOTLddKgYh989VjqWZBwLBGM4Hp4z7
	 v3UgsjcYuY5GwBQGPon3yRvWHqrry2sTeWZvgU8fIjMUCNatWnOkp0AKg27iKByF1Z
	 2SsY/fGBgegGMKyZZbjdD0yMRGY2gU5UZM4ICnmk=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AEB6A3858D26
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AEB6A3858D26
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1741201819; cv=none;
 b=BObp9hwFVlaSPLoOwMYjYB8dvG4ZjYVKvKoM8vEGIbQNLdPv0yxtHuDvK6maHP1/1KbxFCKugIe4gFm/gzleLiB+yY8ivE0g4LwM51O0qolxMCrPLvdf3T2/nMam/pXsjvlFuRh+m2maYutE3AtsHAZF9YjHrY/jZJhpAlKA4FQ=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1741201819; c=relaxed/simple;
 bh=rZCn8fSSGkGnU1Twq+4AS5YHXrX6ffaoob8h6E/jYGs=;
 h=DKIM-Signature:Mime-Version:Subject:From:Date:Message-Id:To;
 b=DF79UjGPYfUP3l5xCj2D/VMn1UrwIN3U5uBs7yvm71nbholQhds/sbW+Lp3xAh28u7t9zctuUnObRcU67DTJxkfC3OhMPjlYmadcKbK6c/9ZJ9R18K5umnNWclBSwB0jYh2rJ52UuYFVf0qRT8Sk+DKKCI9n44AzuccFcSPbhfo=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AEB6A3858D26
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741201817; x=1741806617;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=angRH7CJSmf5UOhguAfqTCdQ5P5iDfAQrp61QU3PBQE=;
 b=uFsPHds6J8OiTgYu+efnYCo7LLUgJLQ7RRpNN5rxZTU9q6E023Vjxz009b7kT2l1wE
 7Q3OTvy8usQZlT3Z7DFtzDsryKVPgbS0m3sB6L5NQP8Mm1sY5UazatIigcz/wReK7SMv
 fnnA5KZvgoOOeAruWI0Fc5aQKpk78/Fwn43SVh9j+46nRbeWcz10a5oP3v+Cny9FHbsr
 8GWngjiMBZxE21NLyb/kSplZJpNZQtE/7sxYNcw9e38DCkLl+GCmqQkYfKSuqe6K5w5p
 titYwX8uULA5F5jR85+CmSmwglOjNIrSrmGa5/EtFTYyUBFHVBvqezkdEImt2tGIoEcT
 51fQ==
X-Gm-Message-State: AOJu0YxbEZRAgOXAFa8pHGoDmBWKpVYNE1DQLqyNHoWF/Iw1ZxUljgCL
 D8RhkbLtenm/ZDdPt8GFH+c5UhHf3NkFdTO5bD6R6PlwqdUrI5cAl2y5rlRTqUgCnnmMzUdmXM0
 u3yufH28GUgS1nIKsy1O8sKpOqjp7paB6IGcMsUiQN+INoKPwdlzFUuNvqRmnniltgEX9mnJHKw
 M8z6c61Q+Po1SaZv5MM5H+/Yzo3/8fcFvQlX7vVWCMrMs=
X-Gm-Gg: ASbGncual7yC4qqxk4edcCTWdhtnOS/7InpQMRM2f1Hkkr1hWV7VZHMA31A6qtEcqxB
 NZK5tlEvsKx7kTQvkpcXUk9yiGV1DKDHGZCDNtFUSaqjtPNObmb2gGS9ETTKE/ad7DB6uZZG+J8
 BEFFGUYGe6J/RBqVU3N9+Q8l315K3EO/Bkux07j/NCeA+EBY3iHIQ1+6c5kYf8s9hdT2xmQhNj1
 veVAl0mko2SdO2ITE94+5AJQLMaorRryScNUnzDAuoXYL39DPpbC9u0nC4HRojDU3jODAoD8EDo
 IFKDrdnnszYXqZpIJPOhIksdSYdP5zSWGNv2lEvNJRlf2EJkBfuqFKIXleJ3X8WAweci0/mV/4R
 YeXdh7bEcp43e
X-Google-Smtp-Source: AGHT+IFg7fkJqaOk0mSW4/vKmtmO0rv2FWjt4F2mFDjY/6E4ei2P8IhQ+xes1SwkvpX/+LBnf/vxQw==
X-Received: by 2002:a17:907:c48c:b0:ac1:f6ba:3b18 with SMTP id
 a640c23a62f3a-ac20dadcb0cmr425106566b.44.1741201817136; 
 Wed, 05 Mar 2025 11:10:17 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.9\))
Subject: Re: Cygwin 3.6: clang cannot use /usr/include/unistd.h, issue with
 |setproctitle_init()| ...
In-Reply-To: <Z8ie5ezqgXKtnmnl@calimero.vinschen.de>
Date: Wed, 5 Mar 2025 20:10:16 +0100
Cc: Corinna Vinschen <corinna-cygwin@cygwin.com>
Message-Id: <7469397F-D50A-40AE-BCD2-15E768ABA77D@unified-streaming.com>
References: <CAKAoaQkjCNVRr3wj_2S=FW+-0YLs6SpxN1Fecws83NRR9E0Q3A@mail.gmail.com>
 <112c2ecc-cfc6-86d4-d7b6-bce46d92197e@t-online.de>
 <Z8ie5ezqgXKtnmnl@calimero.vinschen.de>
To: The Cygwin Mailing List <cygwin@cygwin.com>
X-Mailer: Apple Mail (2.3731.700.6.1.9)
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Dimitry Andric via Cygwin <cygwin@cygwin.com>
Reply-To: Dimitry Andric <dimitry@unified-streaming.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces~archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.com>

Maybe it's because -Wsystem-headers is not enabled? I'm unsure what gcc's default behavior is with -Wall, but if you add an explicit -Wsystem-headers you might still get that warning.

-Dimitry

> On 5 Mar 2025, at 19:58, Corinna Vinschen via Cygwin <cygwin@cygwin.com> wrote:
> 
> 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



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