)]}' { "commit": "1232eef628227ef855c5fa6d94b31778b2e74a85", "tree": "e912e3c9e6c31fe601d59b456f21fa31c11d3bf6", "parents": [ "6bb63a21434b3360dbe7e4bd34889734f361d434" ], "author": { "name": "Ian Lance Taylor", "email": "iant@golang.org", "time": "Fri Jun 21 19:33:24 2019 -0700" }, "committer": { "name": "Ian Lance Taylor", "email": "iant@golang.org", "time": "Sun Jun 23 22:08:06 2019 +0000" }, "message": "compiler: edit error messages to avoid -Wformat-diag warnings\n\nGCC recently introduced -Wformat-diag to scrutinize GCC error messages.\nIt reports a number of warnings about gofrontend code, such as:\n\n../../trunk/gcc/go/gofrontend/import.cc: In member function ‘Type* Import::type_for_index(int, const string\u0026, size_t, bool*)’:\n../../trunk/gcc/go/gofrontend/import.cc:1129:48: warning: unquoted operator ‘\u003e\u003d’ in format [-Wformat-diag]\n 1129 | \"error in %s at %lu: bad type index %d \u003e\u003d %d\",\n | ^~\n\n../../trunk/gcc/go/gofrontend/ast-dump.cc: In member function ‘void Ast_dump_context::dump(Gogo*, const char*)’:\n../../trunk/gcc/go/gofrontend/ast-dump.cc:203:25: warning: unquoted option name ‘-fgo-dump-ast’ in format [-Wformat-diag]\n 203 | \"cannot open %s:%m, -fgo-dump-ast ignored\", dumpname.c_str());\n | ^~~~~~~~~~~~~\n\n../../trunk/gcc/go/gofrontend/expressions.cc: In static member function ‘static Bexpression* Func_expression::get_code_pointer(Gogo*, Named_object*, Location)’:\n../../trunk/gcc/go/gofrontend/expressions.cc:1350:29: warning: misspelled term ‘builtin function’ in format; use ‘built-in function’ instead [-Wformat-diag]\n 1350 | \"invalid use of special builtin function %qs; must be called\",\n | ^~~~~~~~~~~~~~~~\n\n../../trunk/gcc/go/gofrontend/gogo.cc: In member function ‘void Gogo::add_linkname(const string\u0026, bool, const string\u0026, Location)’:\n../../trunk/gcc/go/gofrontend/gogo.cc:2527:4: warning: unquoted sequence of 2 consecutive punctuation characters ‘//’ in format [-Wformat-diag]\n 2527 | (\"%s is not a function; \"\n | ~^~~~~~~~~~~~~~~~~~~~~~~~\n 2528 | \"//go:linkname is only supported for functions\"),\n | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis CL edits error messages to avoid these warnings.\n\nChange-Id: If2f4881e9d02fefaf74efce04c63fab24845dea4\nReviewed-on: https://go-review.googlesource.com/c/gofrontend/+/183497\nReviewed-by: Cherry Zhang \u003ccherryyz@google.com\u003e\n", "tree_diff": [ { "type": "modify", "old_id": "94066cab8c391b89b294d1636c62b6264dfe4dde", "old_mode": 33188, "old_path": "go/ast-dump.cc", "new_id": "b20f7e4e725e282f99a25427d66e4dbcfc51e826", "new_mode": 33188, "new_path": "go/ast-dump.cc" }, { "type": "modify", "old_id": "782899cc1853db5fc0f36cb55dc000f542df9d54", "old_mode": 33188, "old_path": "go/expressions.cc", "new_id": "c9d8ea2a8292272f6944ce2d00dc459c7406dc5f", "new_mode": 33188, "new_path": "go/expressions.cc" }, { "type": "modify", "old_id": "23acaa54f5636ce0c6be9214bafe2463647b27b1", "old_mode": 33188, "old_path": "go/go.cc", "new_id": "12205bd5aa726fbfcce2ebcf7f4d085c678135d4", "new_mode": 33188, "new_path": "go/go.cc" }, { "type": "modify", "old_id": "b135a699e13ac1cb587f14fae8d4e20c34b68f96", "old_mode": 33188, "old_path": "go/gogo.cc", "new_id": "d190ec2f3f02e64a3bb38fb3fec5fc64e51793c8", "new_mode": 33188, "new_path": "go/gogo.cc" }, { "type": "modify", "old_id": "868def7cc7579244a658c3fdd9606455f98cf2aa", "old_mode": 33188, "old_path": "go/import-archive.cc", "new_id": "d5e26ce22a3711fa81f1a15ac56c647cb83b9c16", "new_mode": 33188, "new_path": "go/import-archive.cc" }, { "type": "modify", "old_id": "2d76f75a3de23c7d721b5b4ad0698f1a314bf224", "old_mode": 33188, "old_path": "go/import.cc", "new_id": "abf0b540bd0be1cfb181abd64da5d92bf01b8974", "new_mode": 33188, "new_path": "go/import.cc" }, { "type": "modify", "old_id": "e641b7eaf39f33a1593905fd2b34b9f572cb50e9", "old_mode": 33188, "old_path": "go/lex.cc", "new_id": "82fd35580c6cdd0f55cdac1ac5f7b637ab9baf79", "new_mode": 33188, "new_path": "go/lex.cc" }, { "type": "modify", "old_id": "e611c70466245903d823b51096d70d9cb785bb29", "old_mode": 33188, "old_path": "go/parse.cc", "new_id": "52371b2b032797b148e20078cbfc8f48b9a4c5b8", "new_mode": 33188, "new_path": "go/parse.cc" }, { "type": "modify", "old_id": "4a0116caec1ea8fff8172796a839405b5c2fc598", "old_mode": 33188, "old_path": "go/statements.cc", "new_id": "c0955888b549375e5005fa3e28464f578518c1bd", "new_mode": 33188, "new_path": "go/statements.cc" } ] }