public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jsm28 at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/19967] New: built-in folding causes excess diagnostics Date: Tue, 15 Feb 2005 13:29:00 -0000 [thread overview] Message-ID: <20050215012312.19967.jsm28@gcc.gnu.org> (raw) The folding of built-in functions does not always yield results with the correct return type, causing excess warnings (errors with -pedantic-errors). char *strchr(const char *, int); char *strrchr(const char *, int); char *index(const char *, int); char *rindex(const char *, int); char *strpbrk(const char *, const char *); char *strstr(const char *, const char *); char *p; void f (void) { p = strchr(__func__, 'f'); p = strrchr(__func__, 'f'); p = index(__func__, 'f'); p = rindex(__func__, 'f'); p = strpbrk(__func__, "f"); p = strstr(__func__, "f"); } should compile with no diagnostics, but instead each assignment has "assignment discards qualifiers from pointer target type" because optimizing the built-in function has wrongly changed the return type to "const char *" instead of "char *". This is a regression in 4.0. -- Summary: built-in folding causes excess diagnostics Product: gcc Version: 4.0.0 Status: UNCONFIRMED Keywords: rejects-valid, diagnostic Severity: normal Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jsm28 at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19967
next reply other threads:[~2005-02-15 1:23 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-02-15 13:29 jsm28 at gcc dot gnu dot org [this message] 2005-02-15 14:14 ` [Bug middle-end/19967] [4.0 Regression] " pinskia at gcc dot gnu dot org 2005-02-15 15:46 ` pinskia at gcc dot gnu dot org 2005-02-15 15:50 ` joseph at codesourcery dot com 2005-02-15 15:54 ` pinskia at gcc dot gnu dot org 2005-02-15 17:24 ` kazu at cs dot umass dot edu 2005-02-16 7:01 ` [Bug tree-optimization/19967] " pinskia at gcc dot gnu dot org 2005-02-16 19:32 ` cvs-commit at gcc dot gnu dot org 2005-02-16 19:35 ` kazu at cs dot umass dot edu
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=20050215012312.19967.jsm28@gcc.gnu.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).