From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21149 invoked by alias); 4 Jan 2019 02:21:39 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 21130 invoked by uid 89); 4 Jan 2019 02:21:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=world, world! X-HELO: mail-io1-f41.google.com Received: from mail-io1-f41.google.com (HELO mail-io1-f41.google.com) (209.85.166.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 04 Jan 2019 02:21:37 +0000 Received: by mail-io1-f41.google.com with SMTP id x6so28523709ioa.9 for ; Thu, 03 Jan 2019 18:21:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=B/SuJKk7L+But72eRgC9tdgtYuo9eEEY/CRH3nEbVk0=; b=KxTUrFLxh98i5jInhN/0TF5zeVdM/QZ76CM7Xu9KHGoA2Vop3GeOhygDwW1T1KZh/Z bAq0N0R2oUNqLkyR7u3WUafshwGmpxQZTvN5eXpiVpOmo6kqF+dcLYOY9NOhaPRff0Cn fQ5aHtJXEsUzvn167xrxmPx9thWjSJXUy8j2/vJY32rWOay/DvFCtonhtaaWCz8TGpoP lKUIoiEurO6NHe8iofBgryF8l8Qdk5sD5keACDcSS5XuYy2fSpwOGQSR+XYRvUD+CwF3 lb3wVvtMEVDMovqU3FWNhABiXpUmCG7lYMq2KnkX6aOoW9AFE62WCwNK79a22vXn6FTn WePw== MIME-Version: 1.0 From: Peng Yu Date: Fri, 04 Jan 2019 02:21:00 -0000 Message-ID: Subject: How to just print the output for -H without output anything else? To: "gcc-help@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00005.txt.bz2 Hi, I just want to print the header information. Is there a way to suppress the errors generated (Undefined symbols ...)? Thanks. $ gcc -H -Iincdir main.c . ./main.h .. ./print.h . incdir/print1.h Undefined symbols for architecture x86_64: "_print", referenced from: _main in main-9c47c5.o "_print1", referenced from: _main in main-9c47c5.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ==> main.c <== // vim: set noexpandtab tabstop=2: #include "main.h" #include int main() { print(); print1(); } ==> print.c <== #include void print() { puts("Hello World!"); } ==> incdir/print1.c <== #include void print1() { puts("Hello World1!"); } ==> incdir/print1.h <== // vim: set noexpandtab tabstop=2: void print1(); -- Regards, Peng