From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mr4.vodafonemail.de (mr4.vodafonemail.de [145.253.228.164]) by sourceware.org (Postfix) with ESMTPS id DC0F83858D37 for ; Sun, 15 Jan 2023 16:23:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC0F83858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nexgo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nexgo.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexgo.de; s=vfde-smtpout-mb-15sep; t=1673799799; bh=FxqPOw8Lao4oXQ7KJv5WYZKLYE6XZY4DOqcPdUXYvz0=; h=From:To:Subject:References:Date:In-Reply-To:Message-ID:User-Agent: Content-Type:From; b=QeIBRSshoNXuMlNmlnZOOrOCcSEF6ig/FXets5UfdxRNon+jWeYu5FUwqwxCnb4z1 shM5c6iP0Z519gCukHj88jmlCBgSm42qqzd9zQTbI9kYB46HjqC4jQDMlvGumkbRph 3MFUTke24BwTUbN92W9v2/f2b3pOGYG3Qa3kDMoc= Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr4.vodafonemail.de (Postfix) with ESMTPS id 4Nw0ng3YlSz1yKN for ; Sun, 15 Jan 2023 16:23:19 +0000 (UTC) Received: from Gertrud (p57b9d9db.dip0.t-ipconnect.de [87.185.217.219]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4Nw0nb21f3z9sKF for ; Sun, 15 Jan 2023 16:23:12 +0000 (UTC) From: Achim Gratz To: cygwin@cygwin.com Subject: Re: GCC doesn't find relative includes when passed paths using backward-slashes References: Date: Sun, 15 Jan 2023 17:23:08 +0100 In-Reply-To: (Alexander Grund via Cygwin's message of "Sun, 15 Jan 2023 13:38:31 +0100") Message-ID: <87edrv6a37.fsf@Rainer.invalid> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-purgate-type: clean X-purgate: clean X-purgate-size: 1507 X-purgate-ID: 155817::1673799795-FBFE64DE-53342669/0/0 X-Spam-Status: No, score=-3031.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Alexander Grund via Cygwin writes: > consider the following MWE: > > |$ touch bar/foo.h $ cat bar/main.cpp #include "foo.h" int main(){} > |With this most simple setup calling GCC with `g++ "bar\main.cpp"` > |results in GCC failing to find the include file. However using `g++ > |"bar/main.cpp"` works as expected. | Giving any Cygwin tools non-POSIX path constructs is asking for trouble, notwithstanding the fact that sometimes it works (or seems to work). > |So the compiler does find the CPP file and also is able to resolve > | others paths passed with backslashes (e.g. -I arguments) but > | basically disables resolving includes relative to the file including > | it. For context: This turned up on CI for Boost where > | "|C:\cygwin64\bin" is added to the PATH env variable to be able to > | use the Cygwin GCC with B2. The build system, finding it is running > | on Windows, will pass paths with backward slashes to the > | compiler. Then use a build system that doesn't do this. > | This happens on both CMD with the added PATH and using the > | bash. For reference I tried the same with MinGW and there either > | path separator worked. So it seems to be an issue in the Cygwin > | builds of GCC. No it isn't, just like you couldn't expect this to work on Linux. Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Waldorf MIDI Implementation & additional documentation: http://Synth.Stromeko.net/Downloads.html#WaldorfDocs