public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Ian Lance Taylor <ian@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-7156] compiler: don't warn for print() Date: Wed, 9 Feb 2022 22:16:00 +0000 (GMT) [thread overview] Message-ID: <20220209221600.EA3E4385843B@sourceware.org> (raw) https://gcc.gnu.org/g:e50a79552d567cd49703103d478ab93d805f60c1 commit r12-7156-ge50a79552d567cd49703103d478ab93d805f60c1 Author: Ian Lance Taylor <iant@golang.org> Date: Tue Feb 8 20:19:04 2022 -0800 compiler: don't warn for print() We used to warn for calls to print(), because it doesn't do anything. However, a Go 1.18 test uses that call, and it is valid Go. Change the compiler to just accept it and compile it; this will produce calls to printlock and printunlock, and nothing else. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/384355 Diff: --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/expressions.cc | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 8cbd0c19a8d..52f4b423f02 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -263e8d2a2ab57c6f2b3035f370d40476bda87c9f +b0dcd2d1e5e73952408b9f2d4d86ae12d102b20c The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 3f597654858..1b3b3bf135e 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -10332,16 +10332,7 @@ Builtin_call_expression::do_check_types(Gogo*) case BUILTIN_PRINTLN: { const Expression_list* args = this->args(); - if (args == NULL) - { - if (this->code_ == BUILTIN_PRINT) - go_warning_at(this->location(), 0, - "no arguments for built-in function %<%s%>", - (this->code_ == BUILTIN_PRINT - ? "print" - : "println")); - } - else + if (args != NULL) { for (Expression_list::const_iterator p = args->begin(); p != args->end();
reply other threads:[~2022-02-09 22:16 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220209221600.EA3E4385843B@sourceware.org \ --to=ian@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).