From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CF3FC382B3D7; Wed, 14 Dec 2022 18:40:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF3FC382B3D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671043206; bh=lGboAc7/rTc6MXFqLCD/m16mFcbGw+YH2AyfpWhKDLE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PP+3nwboHYlMMOwKN3kSUR5JeMs6TpCJ7MY9QtI0WUOnUooG3/avKhMl+OWIYah7u 2BojG4BBhpCXe1cuCV9GcmWVHN5hiyaKBPx5gyPAd8Xswlp5bzqzJWMRxUFiGKZKYJ DlMRLBdVD8SSdkX6VKOO5S2BPTLQn5rYzprannJs= From: "terra at gnome dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/108108] "gcc -MM" fails to list all dependencies Date: Wed, 14 Dec 2022 18:40:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: terra at gnome dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108108 --- Comment #4 from M Welinder --- > Since it was not read again, the file is not considered included ... It must have been read -- how else could gcc decide it was the same? # strace -f gcc -MM c.c 2>&1 >Makefile | grep 'open.*\.h' | grep -v / [pid 30494] openat(AT_FDCWD, "a.h", O_RDONLY|O_NOCTTY) =3D 3 [pid 30494] openat(AT_FDCWD, "b.h", O_RDONLY|O_NOCTTY) =3D 3 If it was necessary to open that file, then it's a dependency. > Really #pragma once should just emit a warning just like #import does ... I hear you, :-)=