From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from codesynthesis.com (codesynthesis.com [188.40.148.39]) by sourceware.org (Postfix) with ESMTPS id E7E803858D1E for ; Thu, 21 Apr 2022 04:06:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E7E803858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesynthesis.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=codesynthesis.com Received: from brak.codesynthesis.com (unknown [105.186.193.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by codesynthesis.com (Postfix) with ESMTPSA id 5EFD9604A6; Thu, 21 Apr 2022 04:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codesynthesis.com; s=mail1; t=1650513958; bh=KiK6PVuKb7ZGJWHNg9C9cXeyXwvMttAcvUwS2oYEyVA=; h=Date:From:To:Subject:Message-ID:MIME-Version:From; b=LdrGJjgQ9uT/qclOJS99q+QeB5bXwflf+wsFlFoAY9jIYgI0JsYE4r5m8c3XWABOA 7qgxtp40rQiL770FOlRx1xhSysvHokbp2Er0294VUjQlECy7U4PjCQkFsrz0G1BsIV 2NnmhEBN0WTfvo/p42gDMzPxdiqyCn0su+nvUt2JL0YuS1E5kn3NGqA1HoMzPvQk7h zmX3QflkMs42U9hdftfMhY/Z6hyRM1tAokEZtwJ9s9gnVNkuwP9AdnVvoA1JQ8xE0H AU6NvWbl2D7dO+hPSje2CRS/0I/irXnI0wDAzycIqgAnBt39xknFXS3MnmvkBYnhl5 JLeh8WpmTu+Mw== Received: by brak.codesynthesis.com (Postfix, from userid 1000) id 1E15D1A802AE; Thu, 21 Apr 2022 06:05:52 +0200 (SAST) Date: Thu, 21 Apr 2022 06:05:52 +0200 From: Boris Kolpackov To: Ben Boeckel Cc: gcc@gcc.gnu.org Subject: Re: [modules] Preprocessing requires compiled header unit modules Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Code Synthesis User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2022 04:06:02 -0000 Ben Boeckel writes: > However, for header unit modules, it runs into a problem that imported > header units are required to be compiled and available in the mapper > while scanning for dependencies. > > Example code: > > ```c++ # use-header.cpp > module; > > import "header-unit.hpp"; > > int main(int argc, char* argv[]) { > return good; > } > ``` > > There used to be no need to do this back prior to the modules landing in > `master`, but I can see this being an oversight in the meantime. I don't think it is. A header unit (unlike a named module) may export macros which could affect further dependencies. Consider: import "header-unit.hpp"; // May or may not export macro FOO. #ifdef FOO import "header-unit2.hpp" #endif